gtkMenuNew(show = TRUE)
gtkMenuSetScreen(object, screen = NULL)
gtkMenuReorderChild(object, child, position)
gtkMenuAttach(object, child, left.attach, right.attach, top.attach, bottom.attach)
gtkMenuPopup(object, parent.menu.shell = NULL, parent.menu.item = NULL, func = NULL, data = NULL, button, activate.time)
gtkMenuSetAccelGroup(object, accel.group)
gtkMenuGetAccelGroup(object)
gtkMenuSetAccelPath(object, accel.path)
gtkMenuSetTitle(object, title)
gtkMenuGetTearoffState(object)
gtkMenuGetTitle(object)
gtkMenuPopdown(object)
gtkMenuReposition(object)
gtkMenuGetActive(object)
gtkMenuSetActive(object, index)
gtkMenuSetTearoffState(object, torn.off)
gtkMenuAttachToWidget(object, attach.widget)
gtkMenuDetach(object)
gtkMenuGetAttachWidget(object)
gtkMenuGetForAttachWidget(object)
gtkMenuSetMonitor(object, monitor.num)
gtkMenu(show = TRUE)
gtkMenuPopup
function. The example below shows how an application
can pop up a menu when the 3rd mouse button is pressed.
Connecting the popup signal handler.
## connect our handler which will popup the menu
gSignalConnect(window, "button_press_event", my_popup_handler, menu,
user.data.first=TRUE)
Signal handler which displays a popup menu.
# The popup handler
my_popup_handler <- function(widget, event)
{
stopifnot(widget != NULL)
checkPtrType(widget, "GtkMenu")
stopifnot(event != NULL)## The "widget" is the menu that was supplied when ## gSignalConnect() was called. menu <- widget
if (event[["type"]] == "button-press") { if (event[["button"]] == 3) { menu$popup(button=event[["button"]], activate.time=event[["time"]]) return(TRUE) } }
return(FALSE) }
gtkMenu
is the equivalent of gtkMenuNew
.