gcheckbox {gWidgets} | R Documentation

## Constructor of widget to indicate whether a value is desired or not

### Description

A checkbox shows a value and a box to check indicating if the value is desired or not.

### Usage

    gcheckbox(text, checked = FALSE, handler = NULL, action = NULL,
    container = NULL, ..., toolkit = guiToolkit())

### Arguments

`text` | Text to show by box
`checked` | Logical indicating initial state of box
`handler` | Called when box is toggled.
`action` | Passed to handler
`container` | Optional container to attach widget to.
`...` |
`toolkit` | Which toolkit to use?

### Details

The value of the widget is either `TRUE` or `FALSE`.

The `svalue` method returns a logical indicating `TRUE` if the box is checked.

The `svalue<-` method can be used to set the value using a logical.

The `"["` method returns the label on the box.

The `"[<-"` method can be used to change the label on the box.

Any `addhandlerchanged` handler is called when the button is toggled.

### Author(s)

John Verzani

### See Also

Methods for gComponent objects are detailed in `gWidgets-methods`.

Event Handlers are detailed in `gWidgets-handlers`.

### Examples

    ## Not run:
     gcheckbox("checked", container=TRUE, handler=function(h,...) {
    cat("The widget is checked",svalue(h$obj), "\n")
    })
    ## End(Not run)

[Package gWidgets version 0.0-25 Index]