Next: 16.1.7 Example
Up: 16.1 Built-in Module stdwin
Previous: 16.1.5 Bitmap Objects
A text-edit object represents a text-edit block.
For semantics, see the STDWIN documentation for C programmers.
The following methods exist:
- arrow(code)
-
Pass an arrow event to the text-edit block.
The
code
must be one of
WC_LEFT
,
WC_RIGHT
,
WC_UP
or
WC_DOWN
(see module
stdwinevents
).
- draw(rect)
-
Pass a draw event to the text-edit block.
The rectangle specifies the redraw area.
- event(type, window, detail)
-
Pass an event gotten from
stdwin.getevent()
to the text-edit block.
Return true if the event was handled.
- getfocus()
-
Return 2 integers representing the start and end positions of the
focus, usable as slice indices on the string returned by
gettext()
.
- getfocustext()
-
Return the text in the focus.
- getrect()
-
Return a rectangle giving the actual position of the text-edit block.
(The bottom coordinate may differ from the initial position because
the block automatically shrinks or grows to fit.)
- gettext()
-
Return the entire text buffer.
- move(rect)
-
Specify a new position for the text-edit block in the document.
- replace(str)
-
Replace the text in the focus by the given string.
The new focus is an insert point at the end of the string.
- setfocus(i, j)
-
Specify the new focus.
Out-of-bounds values are silently clipped.
- settext(str)
-
Replace the entire text buffer by the given string and set the focus
to
(0, 0)
.
- setview(rect)
-
Set the view rectangle to rect. If rect is
None
,
viewing mode is reset. In viewing mode, all output from the text-edit
object is clipped to the viewing rectangle. This may be useful to
implement your own scrolling text subwindow.
- close()
-
Discard the text-edit object. It should not be used again.
Next: 16.1.7 Example
Up: 16.1 Built-in Module stdwin
Previous: 16.1.5 Bitmap Objects
guido@cnri.reston.va.us