gmenu: Menubar implementation

Description Usage Arguments Details Value Examples

Description

A menubar for gwindow instances. Menu items are specified with a named list. The heirarchical nature of the list maps to the heirarchical menu structure, with the names giving the menu names. The menu actions are specified using gaction elements. These may also be gseperator() instances.

Usage

1
2
  gmenu(menulist, popup = FALSE, action = NULL,
    container = NULL, ..., ext.args = NULL)

Arguments

menulist

list of actions. Actions must have parent specified

popup

Logical. ignored for now

action

optional value to paramaterize handler

container

parent container

...

passed along to add call of the container. Can be used to adjust layout parameters. May also have other uses.

ext.args

A list of extra arguments to pass to the ExtJS constructor

Details

Menubars should only be added to gwindow instances, but this is not strictly enforced, any Ext.Panel-based container would do.

Menubars can take checkboxes and radio buttons. Specify them without a parent container.

Value

an ExtWidget object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
w <- gwindow()
sb <- gstatusbar("Powered by gWidgetsWWW and Rook", cont=w)
stub = function(...) galert("stub", parent=w)
l <- list(
File = list(open=gaction("Open", handler=stub, parent=w),
            new = gaction("New", handler=stub, parent=w),
            gseparator(),
            quit = gaction("Quit", handler=stub, parent=w)),
Edit = list(save = gaction("Save", handler=stub, parent=w),
            gcheckbox("some state", checked=TRUE, handler=stub)
            )
)
m <- gmenu(l, cont=w)
gtext("Text goes here", cont=w)

jverzani/gWidgetsWWW2.rapache documentation built on May 20, 2019, 5:19 a.m.