Multiline text edit constructor
The multiline text widget has its main property the text contained within.
The svalue
will return a string (length-1 character
vector) with embedded newlines
The "change" handler is addHandlerKeystroke
Use addHandlerSelectionChanged
to monitor the selection
generic for toolkit dispatch
insert text into a gtext buffer
insert method for gtext
dispose method for gtext clears buffer
The svalue
method for a gtext object returns a) the buffers
content; b) the selected text (if drop=TRUE
, but not
NULL
), this can be used to set the selected value, as well;
c) the index of the selection if index=TRUE
.
gtext(text = NULL, width = NULL, height = 300, font.attr = NULL, wrap = TRUE, handler = NULL, action = NULL, container = NULL, ..., toolkit = guiToolkit()) .gtext(toolkit, text = NULL, width = NULL, height = 300, font.attr = NULL, wrap = TRUE, handler = NULL, action = NULL, container = NULL, ...) insert(obj, value, where = c("end", "beginning", "at.cursor"), font.attr = NULL, do.newline = TRUE, ...) ## S3 method for class 'GText' insert(obj, value, where = c("end", "beginning", "at.cursor"), font.attr = NULL, do.newline = TRUE, ...) ## S3 method for class 'GText' dispose(obj, ...) ## S3 method for class 'GText' svalue(obj, index = NULL, drop = NULL, ...)
text |
initial text |
width |
width of widget |
height |
height of widget (when width is specified) |
font.attr |
font attributes for text buffer. One can also specify font attributes for insertion. The font attributes are specified with a list with named components, with names and values coming from:
|
wrap |
logical do lines wrap |
handler |
A handler assigned to the default change
signal. Handlers are called when some event triggers a widget to
emit a signal. For each widget some default signal is assumed, and
handlers may be assigned to that through Handlers may also be added via |
action |
User supplied data passed to the handler when it is called |
container |
A parent container. When a widget is created it can be incorporated into the widget heirarchy by passing in a parent container at construction time. (For some toolkits this is not optional, e.g. gWidgets2tcltk or gWidgets2WWW2.) |
... |
These values are passed to the |
toolkit |
Each widget constructor is passed in the toolkit it
will use. This is typically done using the default, which will
lookup the toolkit through |
obj |
object |
value |
text to insert |
where |
position of insertion |
do.newline |
logical add a newline at end |
index |
NULL or logical. If |
drop |
NULL or logical. If widget supports it, drop will work as it does in a data frame or perhaps someother means. |
called for side effect
with gWidgetstcltk the allocation of size to the
widget may be incorrect. It is best to wait until the widget is
added before displaying its parent window. See the visible
argument for gwindow
.
## Not run: w <- gwindow("gtext example", visible=FALSE) g <- gvbox(cont=w) t1 <- gtext("initial text", container=g) t2 <- gtext("monospace", font.attr=list(family="monospace"), container=g) insert(t2, "new text in bold", font.attr=list(weight="bold")) visible(w) <- TRUE ## End(Not run)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.