Next: Window Object Prev: stdwin Up: stdwin Top: Top
stdwin
stdwin
module:
None
if it applies to no window in particular;
the third element is type-dependent.
Names for event types and command codes are defined in the standard
module
stdwinevent
.
()
.
None
if no
window is currently active. (This can be emulated by monitoring
WE_ACTIVATE and WE_DEACTIVATE events.)
'*'
; returns all
available fonts. If the underlying window system is X11, other
patterns follow the standard X11 font selection syntax (as used e.g.
in resource definitions), i.e. the wildcard character '*'
matches any sequence of characters (including none) and '?'
matches any single character.
if stdwin.fetchcolor('black') <> \
stdwin.fetchcolor('red') <> \
stdwin.fetchcolor('white'):
print 'color machine'
else:
print 'monochrome machine'
textwidth
,
textbreak
, lineheight
and baseline
below.
This accepts two more optional parameters, size and style:
Size is the font size (in `points').
Style is a single character specifying the style, as follows:
'b'
= bold,
'i'
= italic,
'o'
= bold + italic,
'u'
= underline;
default style is roman.
Size and style are ignored under X11 but used on the Macintosh.
(Sorry for all this complexity --- a more uniform interface is being designed.)
menucreate
below.
Warning: the menu only appears in a window as long as the object
returned by this call exists.
KeyboardInterrupt
exception is raised.
KeyboardInterrupt
exception is raised.
KeyboardInterrupt
exception is raised.
stdwinevents
.
Selection WS_PRIMARY
is the
primary
selection (used by
xterm,
for instance);
selection WS_SECONDARY
is the
secondary
selection; selection WS_CLIPBOARD
is the
clipboard
selection (used by
xclipboard).
On the Macintosh, this always returns an empty string.
setselection()
).
connectionnumber()
is named after the corresponding function in
X11 and STDWIN, while fileno()
makes it possible to use the
stdwin
module as a ``file'' object parameter to
select.select()
. Note that if select()
implies that
input is possible on stdwin
, this does not guarantee that an
event is ready --- it may be some internal communication going on
between the X server and the client library. Thus, you should call
stdwin.pollevent()
until it returns None
to check for
events if you don't want your program to block. Because of internal
buffering in X11, it is also possible that stdwin.pollevent()
returns an event while select()
does not find stdwin
to
be ready, so you should read any pending events with
stdwin.pollevent()
until it returns None
before entering
a blocking select()
call.