Next: Stdwin Example
Prev: Bitmap Object
Up: stdwin
Top: Top
8.1.6. Text-edit Object Methods
A text-edit object represents a text-edit block.
For semantics, see the STDWIN documentation for C programmers.
The following methods exist:
- arrow (code) -- Method on text-edit
-
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) -- Method on text-edit
-
Pass a draw event to the text-edit block.
The rectangle specifies the redraw area.
- event (type, window, detail) -- Method on text-edit
-
Pass an event gotten from
stdwin.getevent()
to the text-edit block.
Return true if the event was handled.
- getfocus () -- Method on text-edit
-
Return 2 integers representing the start and end positions of the
focus, usable as slice indices on the string returned by
gettext()
.
- getfocustext () -- Method on text-edit
-
Return the text in the focus.
- getrect () -- Method on text-edit
-
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 () -- Method on text-edit
-
Return the entire text buffer.
- move (rect) -- Method on text-edit
-
Specify a new position for the text-edit block in the document.
- replace (str) -- Method on text-edit
-
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) -- Method on text-edit
-
Specify the new focus.
Out-of-bounds values are silently clipped.
- settext (str) -- Method on text-edit
-
Replace the entire text buffer by the given string and set the focus
to
(0, 0)
.
- setview (rect) -- Method on text-edit
-
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 () -- Method on text-edit
-
Discard the text-edit object. It should not be used again.