Next: 16.1.3 Drawing Objects
Up: 16.1 Built-in Module stdwin
Previous: 16.1.1 Functions Defined in
Window objects are created by stdwin.open(). They are closed
by their close() method or when they are garbage-collected.
Window objects have the following methods:
- begindrawing()
-
Return a drawing object, whose methods (described below) allow drawing
in the window.
- change(rect)
-
Invalidate the given rectangle; this may cause a draw event.
- gettitle()
-
Returns the window's title string.
- getdocsize()
-
Return a pair of integers giving the size of the document as set by
setdocsize().
- getorigin()
-
Return a pair of integers giving the origin of the window with respect
to the document.
- gettitle()
-
Return the window's title string.
- getwinsize()
-
Return a pair of integers giving the size of the window.
- getwinpos()
-
Return a pair of integers giving the position of the window's upper
left corner (relative to the upper left corner of the screen).
- menucreate(title)
-
Create a menu object referring to a local menu (a menu that appears
only in this window).
Methods of menu objects are described below.
Warning: the menu only appears as long as the object
returned by this call exists.
- scroll(rect, point)
-
Scroll the given rectangle by the vector given by the point.
- setdocsize(point)
-
Set the size of the drawing document.
- setorigin(point)
-
Move the origin of the window (its upper left corner)
to the given point in the document.
- setselection(i, str)
-
Attempt to set X11 selection number
i
to the string
str.
(See stdwin method
getselection()
for the meaning of
i.)
Return true if it succeeds.
If succeeds, the window ``owns'' the selection until
(a) another application takes ownership of the selection; or
(b) the window is deleted; or
(c) the application clears ownership by calling
stdwin.resetselection(i).
When another application takes ownership of the selection, a
WE_LOST_SEL
event is received for no particular window and with the selection number
as detail.
Ignored on the Macintosh.
- settimer(dsecs)
-
Schedule a timer event for the window in
dsecs/10
seconds.
- settitle(title)
-
Set the window's title string.
- setwincursor(name)
-
Set the window cursor to a cursor of the given name.
It raises the
RuntimeError
exception if no cursor of the given name exists.
Suitable names include
'ibeam',
'arrow',
'cross',
'watch'
and
'plus'.
On X11, there are many more (see
`<X11/cursorfont.h>').
- setwinpos(h, v)
-
Set the the position of the window's upper left corner (relative to
the upper left corner of the screen).
- setwinsize(width, height)
-
Set the window's size.
- show(rect)
-
Try to ensure that the given rectangle of the document is visible in
the window.
- textcreate(rect)
-
Create a text-edit object in the document at the given rectangle.
Methods of text-edit objects are described below.
- setactive()
-
Attempt to make this window the active window. If successful, this
will generate a WE_ACTIVATE event (and a WE_DEACTIVATE event in case
another window in this application became inactive).
- close()
-
Discard the window object. It should not be used again.
Next: 16.1.3 Drawing Objects
Up: 16.1 Built-in Module stdwin
Previous: 16.1.1 Functions Defined in
guido@cnri.reston.va.us