glabel: Basic label widget

Description Usage Arguments Value Author(s) Examples

View source: R/glabel.R

Description

The basic label widget allows one to label areas of a GUI using text. The most common use would be to label fields in a form. For gWidgets2 labels may be editable or responsive to mouse clicks, although it is the author's experience that such uses are not expected by the end user.

The svalue methods refer to the main property of the label, its text.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
glabel(
  text = "",
  markup = FALSE,
  editable = FALSE,
  handler = NULL,
  action = NULL,
  container = NULL,
  ...,
  toolkit = guiToolkit()
)

.glabel(
  toolkit,
  text,
  markup = FALSE,
  editable = FALSE,
  handler = NULL,
  action = NULL,
  container = NULL,
  ...
)

## S3 replacement method for class 'GLabel'
 svalue(obj, index=TRUE, ...) <- value

Arguments

text

character. Collapsed using a newline to a single string.

markup

logical. If toolkit supports markup, this indicates it will be used. It is suggested that the font<- method be used, though for gWidgets2Qt markup is more convenient.

editable

If TRUE, then clicking on label will enable user-editing of the text.

handler

optional handler. If given, added through addHandlerChanged. Overridden if editable=TRUE.

action

passed to handler through action component of first argument of handler. For buttons, this may also be a GAction instance.

container

parent container (Optional for some toolkits, but not all).

...

passed to add method of parent container

toolkit

toolkit instance

obj

object of method call

index

NULL or logical. If TRUE and widget supports it an index, instead of a value will be returned.

value

value to assign for selection or property

Value

a GLabel instance. While this object has its own (reference) methods, one primarily interacts with it through S3 methods defined within the package.

Author(s)

john verzani

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
w <- gwindow("gformlayout", visible=FALSE)
g <- gvbox(container=w)
g$set_borderwidth(10)

l1 <- glabel("static label", container=g)
l2 <- glabel("bold label", container=g)
font(l2) <- list(weight="bold")
l3 <- glabel("editable label. Click me", editable=TRUE, container=g)

visible(w) <- TRUE


## End(Not run)

gWidgets2 documentation built on Jan. 11, 2022, 1:07 a.m.