You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-27Lines changed: 6 additions & 27 deletions
Original file line number
Diff line number
Diff line change
@@ -29,33 +29,12 @@ My most sincere thanks and acknowledgement. amongst many others (see AUTHORS.txt
29
29
## Window Features <aname="window-features"></a>
30
30
31
31
There are three kinds of functions to be used within PyWinCtl:
32
-
- General, independent functions: These functions can be directly invoked at module level, without the need of referencing a Window object
33
-
- Window class:
34
-
- Methods: You need a Window object to control or get info on the target window on screen. It is possible to get a Window object by using any of the general methods (e.g. getActiveWidow() or getWindowsWithTitle()). You can also use the window id, as returned by PyQt's self.winId() or tkinter's root.frame(), which is very handy to get the Window object for your own application.
35
-
- Properties: Window attributes, getters and setters, that also require to use a Window object
36
-
37
-
A very simple example:
38
-
39
-
```
40
-
import pywinctl as pwc
41
-
42
-
win = pwc.getActiveWindow() # General function. Directly invoked using the module (not a Window object)
43
-
44
-
if win is not None:
45
-
print("ACTIVE WINDOW", win.title) # Window property, invoked using a Window object
46
-
position = win.position # Window property, invoked using a Window object
47
-
print("INITIAL POSITION", position)
48
-
x, y = position
49
-
win.moveTo(x + 10, y + 10) # Window method, invoked using a Window object
50
-
print("INTERMEDIATE POSITION", win.position)
51
-
win.topleft = (win.left + 20, win.top + 20) # Window property which can also be set
52
-
print("FINAL POSITION", win.position)
53
-
54
-
else:
55
-
print("NOT FOUND)
56
-
```
57
-
58
-
These functions are available at the moment, in all three platforms (Windows, Linux and macOS)
32
+
- General, independent functions: These functions can be directly invoked at module level, without the need of referencing a Window object (e.g. `pywinctl.getActiveWindow()` or `pywinctl.getAllTitles()`)
33
+
- Window class: You need a Window object to control or get info on the target window on screen. It is possible to get a Window object by using any of the general methods (e.g. getActiveWidow() or getWindowsWithTitle()). You can also use the window id, as returned by PyQt's self.winId() or tkinter's root.frame(), which is very handy to get the Window object for your own application.
34
+
- Methods: functions within Window class to get info or perform actions and changes on target window (e.g. `window.resizeTo(800, 600)` or `window.close()`)
35
+
- Properties: Window attributes, getters and setters, that also require to use a Window object (e.g. `window.title` or `window.center = (500, 300)`)
36
+
37
+
These features are available at the moment, in all three platforms (Windows, Linux and macOS)
59
38
60
39
| General, independent functions: | Window class methods: | Window class properties: |
0 commit comments