pyui.desktop
index
c:\ninja\projects\pyui\pyui\desktop.py

The PyUI Desktop. This manages the parts of PyUI that are above the scope of individual windows.

 
Classes
            
Desktop
guiCallback
guiEvent
 
class Desktop
      The Desktop. I am the container for all global PyUI data.
 
   Methods defined here:
__init__(self, renderer, width, height, fullscreen, theme)
activateWindow(self, window)
This adds a window to the set of windows and puts it on top, except
for any topMost widgets on the screen.
addCallback(self, method, interval=0)
addDirtyRect(self, rect)
addDirtyWidget(self, widget)
addWindow(self, window)
This adds a window to the set of windows and puts it on top, except
for any topMost widgets on the screen.
collideRects(self, rect1, rect2)
destroyWidget(self, widget)
cleanup all global references to widget. This is called by destroy() so don't call it twice.
(internal)
dirtyCollidingWindows(self, inRect)
If a dirty rect collides with any other rects, they should be dirty also. This recurses
so that all colliding rects get dirtied. the second parameter to setDirty() prevents infinite
recursion.
draw(self)
Called to draw the widgets!
enableTooltip(self, interval)
findWidget(self, id)
Lookup a widget by its ID.
(public)
findWindowByHandle(self, handle)
getFocus(self)
return the current focused widget.
getModal(self)
getMustFill(self)
getTheme(self)
return the global theme object
handleEvent(self, event)
Process all outstanding events.
(private)
nextID(self)
postEvent(self, type, id=0)
Post an event object into the system. Comes from a widget object.
(internal)
postUserEvent(self, type, x=0, y=0, key=0, mods=0)
Post a user event into the system. This comes from a non-widget object
(public)
quit(self)
Called to destroy all the windows on shutdown.
readTimer(self)
registerHandler(self, eventType, handler)
Register a user defined handler for an event.
(public)
registerWidget(self, widget)
Register a top level window instance with the system.
(internal)
removeCallback(self, callback)
removeWidget(self, widget)
Remove a widget previously registered from the top-level widget list
setFocus(self, widget)
Set the focus to this widget.
setModal(self, window)
Sets the modal window.
(internal)
setMustFill(self)
tell the UI the screen must be cleared. if this is not set, only dirt rects get updated.
Setting this means that all the windows will redraw.
setTheme(self, theme)
sets the global theme object
setWaiting(self, value)
update(self)
Called constantly by the application to process PyUI events and scheduled callbacks.
updateModal(self, event)
in modal mode, only the modal dialog gets mouse events
updateToolTips(self, event)

Data and non-method functions defined here:
__doc__ = 'The Desktop. I am the container for all global PyUI data.\n '
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
__module__ = 'pyui.desktop'
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
lastEvent = 1000
int(x[, base]) -> integer
 
Convert a string or number to an integer, if possible.  A floating point
argument will be truncated towards zero (this does not include a string
representation of a floating point number!)  When converting a string, use
the optional base.  It is an error to supply a base when converting a
non-string.
theDesktop = None
 
class guiCallback
      a timed callback object. If the callback method returns a logical true, then the callback will
automatically be removed. This makes it easy to provide 1-shot timed callbacks. A callback with an interval
of 0 will be called on every frame.
 
   Methods defined here:
__init__(self, method, interval, lastTrigger)
process(self, time)

Data and non-method functions defined here:
__doc__ = 'a timed callback object. If the callback method ...rval\n of 0 will be called on every frame.\n '
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
__module__ = 'pyui.desktop'
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
 
class guiEvent
      an event that can be processed by the system.
 
   Methods defined here:
__init__(self, type, id=0, x=0, y=0, key=0, mods=0)

Data and non-method functions defined here:
__doc__ = 'an event that can be processed by the system.\n '
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
__module__ = 'pyui.desktop'
str(object) -> string
 
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
 
Functions
            
getDesktop()
getRenderer()
getTheme()
getUserEvent()
Request an event ID in the user event space.
NOTE: this is not part of the desktop as it can be called before the desktop object
is created.
(public)
readTimer()
 
Data
             CENTER = 5
CHAR = 8192
CLICKED = 12288
CLIP = 5
DIALOGCLOSED = 12290
EAST = 2
EVENT_KEYBOARD = 8192
EVENT_MASK = 61440
EVENT_MOUSE = 4096
EVENT_SYSTEM = 12288
GRADIENT = 1
HIT_FRAME_CLOSE = 'FRAME_CLOSE'
HIT_FRAME_MOVE = 'FRAME_MOVE'
HIT_FRAME_RESIZE_BOTTOM = 'FRAME_RESIZE_BOTTOM'
HIT_FRAME_RESIZE_BOTTOM_RIGHT = 'FRAME_RESIZE_BOTTOM_RIGHT'
HIT_FRAME_RESIZE_RIGHT = 'FRAME_RESIZE_RIGHT'
IMAGE = 2
IMAGE_ROT = 7
KEYDOWN = 8193
KEYUP = 8194
K_0 = 48
K_1 = 49
K_2 = 50
K_3 = 51
K_4 = 52
K_5 = 53
K_6 = 54
K_7 = 55
K_8 = 56
K_9 = 57
K_A = 65
K_ALT = 18
K_B = 66
K_BACKSPACE = 8
K_C = 67
K_CAPITAL = 20
K_CONTROL = 17
K_D = 68
K_DELETE = 46
K_DOWN = 40
K_E = 69
K_END = 35
K_ESCAPE = 27
K_F = 70
K_F1 = 112
K_F10 = 121
K_F11 = 122
K_F12 = 123
K_F2 = 113
K_F3 = 114
K_F4 = 115
K_F5 = 116
K_F6 = 117
K_F7 = 118
K_F8 = 119
K_F9 = 120
K_G = 71
K_H = 72
K_HOME = 36
K_I = 73
K_INSERT = 45
K_J = 74
K_K = 75
K_L = 76
K_LEFT = 37
K_M = 77
K_N = 78
K_NUMLOCK = 144
K_O = 79
K_P = 80
K_PAD0 = 96
K_PAD1 = 97
K_PAD2 = 98
K_PAD3 = 99
K_PAD4 = 100
K_PAD5 = 101
K_PAD6 = 102
K_PAD7 = 103
K_PAD8 = 104
K_PAD9 = 105
K_PADDECIMAL = 110
K_PADDIVIDE = 111
K_PADENTER = 13
K_PADMINUS = 109
K_PADPLUS = 107
K_PADTIMES = 106
K_PAGEDOWN = 34
K_PAGEUP = 33
K_PAUSE = 19
K_Q = 81
K_R = 82
K_RETURN = 13
K_RIGHT = 39
K_S = 83
K_SCROLL = 145
K_SHIFT = 16
K_SPACE = 32
K_T = 84
K_TAB = 9
K_U = 85
K_UP = 38
K_V = 86
K_W = 87
K_X = 88
K_Y = 89
K_Z = 90
LINE = 6
LIST_SELECTED = 12291
LMOUSEBUTTONDOWN = 4097
LMOUSEBUTTONUP = 4098
MENU_EXIT = 12294
MMOUSEBUTTONDOWN = 4101
MMOUSEBUTTONUP = 4102
MOD_ALT = 768
MOD_CONTROL = 192
MOD_LALT = 256
MOD_LCONTROL = 64
MOD_LSHIFT = 1
MOD_NONE = 0
MOD_RALT = 512
MOD_RCONTROL = 128
MOD_RSHIFT = 2
MOD_SHIFT = 3
MOUSEMOVE = 4096
MOUSEWHEEL = 4103
NONE = 0
NORTH = 3
QUIT = 12293
RECT = 0
RMOUSEBUTTONDOWN = 4099
RMOUSEBUTTONUP = 4100
SCROLLPOS = 12289
SOUTH = 4
TEXT = 3
TEXT_HEIGHT = 16
THEME_SCREEN_HEIGHT = 'SCREENHEIGHT'
THEME_SCREEN_WIDTH = 'SCREENWIDTH'
TREENODE_SELECTED = 12292
USEREVENT = 16384
VIEW = 4
WEST = 1
__file__ = r'.\pyui\desktop.pyc'
__name__ = 'pyui.desktop'