Home | Trees | Index | Help |
|
---|
Package pywm :: Class WM |
|
pywm.WM is the main PYWM class that you should subclass when building your own custom window manager.
Encapsulates the Pythonised 'FLWM' window manager for X, into a python class.
Subclass this and override methods according to your tastes
Python components written by David McNab <david@freenet.org.au>Method Summary | |
---|---|
Constructor. | |
Add a set of handlers for various events. | |
Allows you to bind a Ctrl-Alt key combo to a function | |
Arranges all the windows cascaded from top left. | |
Closes current window | |
Returns the current x, y coordinates of the mouse as a tuple | |
Returns x, y size of the screen as a tuple | |
Switches to next desk | |
Switches to next window | |
Switches to previous desk | |
Switches to previous window | |
Returns the index of win in the window creation order, or -1 if there (oops) is no such window. | |
Launch a new window in a separate process | |
Moves the current window in the specified direction. | |
Called when an existing window is activated | |
Called when a button click is received. | |
Called when a new window is created (or an existing one un-hidden) | |
Called when an existing window is deactivated | |
Called when an existing window is being destroyed (or hidden) | |
Called when the mouse pointer enters a window | |
Called when a Ctrl-Alt key sequence is received. | |
Called when the size of the window changes. | |
Callback which is invoked when WM starts up. | |
Pans all the windows on the screen | |
Pans all the windows on the screen downwards | |
Pans all the windows on the screen to the left | |
Pans all the windows on the screen to the right | |
Pans all the windows on the screen upwards | |
Moves the current window in the specified direction. | |
Launch the window manager, and receive events via callbacks. | |
Pops up the main window manager menu | |
Toggles maximise on the current window | |
Toggles maximise on the current window | |
Toggles maximise on the current window | |
Maps a window handle to a window object. | |
Returns a ref to the window with index idx in the creation order | |
Zooms in or out by a given factor. | |
Zooms in to the current view. | |
Zooms in to the current view, relative to mouse position | |
Zooms out from the current view. | |
Zooms out from the current view, relative to mouse position | |
Makes a window known to this wm object | |
Deletes a window's mapping from our dict. |
Class Variable Summary | |
---|---|
dict |
windows = {}
|
dict |
_keyBindings = {}
|
dict |
_keyBindingsArg = {}
|
dict |
_optionKeywords = {'bg2': '-bg2', 'bg': '-bg', 'cbg': '-...
|
dict |
_options = {}
|
Method Details |
---|
__init__(self,
**kwds)
|
addHandlers(self, **kwds)Add a set of handlers for various events. These are given as 'eventname=func' keywords. Available eventname keywords are:
|
bindKey(self, func, arg, key, shift, control, alt, meta)Allows you to bind a Ctrl-Alt key combo to a function Arguments:
When the key combination gets pressed, the function you give will get called with the argument you give. If you find it hard to remember the 'shift'/'control'/'alt'/'meta' order, just think 'history' - the Shift key was the first to be added (in typewriters), then Ctrl (with ASCII), then Alt (with the IBM PC), then Meta (contributed by Microsoft with Windows). |
cascadeWindows(self, spacing=30)Arranges all the windows cascaded from top left. |
closeCurrent(self, arg=None)Closes current window |
getMousePos(self, arg=None)Returns the current x, y coordinates of the mouse as a tuple |
getScreenSize(self, arg=None)Returns x, y size of the screen as a tuple |
goNextDesk(self, arg=None)Switches to next desk |
goNextWindow(self, arg=None)Switches to next window |
goPrevDesk(self, arg=None)Switches to previous desk |
goPrevWindow(self, arg=None)Switches to previous window |
indexFromWindow(self, win)Returns the index of win in the window creation order, or -1 if there (oops) is no such window. |
launch(self, cmd)Launch a new window in a separate process Arguments:
|
moveCurrent(self, direction)Moves the current window in the specified direction. Arguments:
|
on_activate(self, win)Called when an existing window is activated |
on_buttonPress(self, button)Called when a button click is received. Buttons 1, 2, 3, 4, 5 are left-click, right-click, middle-click, wheelscroll up and wheelscroll down, respectively. If you override this, you should accept a single argument, 'button_num', and return 1 if you've handled it locally, or 0 if you want the WM to handle it instead. NOT YET WORKING |
on_create(self, win)Called when a new window is created (or an existing one un-hidden) |
on_deactivate(self, win)Called when an existing window is deactivated |
on_destroy(self, win)Called when an existing window is being destroyed (or hidden) If overriding in a subclass, call this parent method just before you exit |
on_enter(self, win)Called when the mouse pointer enters a window If overriding, just accept a single argument, hWin NOT YET WORKING |
on_keyEvent(self, key)Called when a Ctrl-Alt key sequence is received. |
on_resize(self, win, x, y, w, h)Called when the size of the window changes. If overriding, you need to accept the arguments:
|
on_startup(self)Callback which is invoked when WM starts up. Note that this callback fires *after* all the existing windows have been re-framed (and the on_create callbacks fired), and *before* the main WM event loop starts up. Override this if you want to do your own processing during startup. |
pan(self, dx=None, dy=None)Pans all the windows on the screen Arguments:
|
panDown(self, amount=30)Pans all the windows on the screen downwards Arguments:
|
panLeft(self, amount=30)Pans all the windows on the screen to the left Arguments:
|
panRight(self, amount=30)Pans all the windows on the screen to the right Arguments:
|
panUp(self, amount=30)Pans all the windows on the screen upwards Arguments:
|
resizeCurrent(self, how)Moves the current window in the specified direction. Arguments:
|
run(self)Launch the window manager, and receive events via callbacks. If overriding this in a subclass, don't forget to call this parent method. |
showMenu(self, arg=None)Pops up the main window manager menu |
toggleMaxCurrent(self, arg=None)Toggles maximise on the current window |
toggleMaxHeightCurrent(self, arg=None)Toggles maximise on the current window |
toggleMaxWidthCurrent(self, arg=None)Toggles maximise on the current window |
window(self, hWin)Maps a window handle to a window object. You should never need to call this yourself |
windowFromIndex(self, idx)Returns a ref to the window with index idx in the creation order |
zoom(self, factor=1, xView=None, yView=None)Zooms in or out by a given factor. Arguments:
|
zoomIn(self, factor=1.1000000000000001, fromMouse=False)Zooms in to the current view. Arguments:
|
zoomInMouse(self, factor=1.1000000000000001)Zooms in to the current view, relative to mouse position Arguments:
|
zoomOut(self, factor=0.88, fromMouse=False)Zooms out from the current view. Arguments:
|
zoomOutMouse(self, factor=0.88)Zooms out from the current view, relative to mouse position Arguments:
|
_addWin(self, hWin)Makes a window known to this wm object Used by the lower level window create event handler. Don't call this yourself. |
_delWin(self, hWin)Deletes a window's mapping from our dict. Called by underlying handler of window delete events. Don't call this yourself |
Class Variable Details |
---|
windows
|
_keyBindings
|
_keyBindingsArg
|
_optionKeywords
|
_options
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Mon Feb 27 15:47:08 2006 | http://epydoc.sf.net |