Learn R Programming

RGtk2 (version 2.20.31)

gtkDialogNewWithButtons: gtkDialogNewWithButtons

Description

Creates a new GtkDialog with title title (or NULL for the default title; see gtkWindowSetTitle) and transient parent parent (or NULL for none; see gtkWindowSetTransientFor). The flags argument can be used to make the dialog modal (GTK_DIALOG_MODAL) and/or to have it destroyed along with its transient parent (GTK_DIALOG_DESTROY_WITH_PARENT). After flags, button text/response ID pairs should be listed, with a NULL pointer ending the list. Button text can be either a stock ID such as GTK_STOCK_OK, or some arbitrary text. A response ID can be any positive number, or one of the values in the GtkResponseType enumeration. If the user clicks one of these dialog buttons, GtkDialog will emit the gtkDialogResponse signal with the corresponding response ID. If a GtkDialog receives the "delete-event" signal, it will emit ::response with a response ID of GTK_RESPONSE_DELETE_EVENT. However, destroying a dialog does not emit the ::response signal; so be careful relying on ::response when using the GTK_DIALOG_DESTROY_WITH_PARENT flag. Buttons are from left to right, so the first button in the list will be the leftmost button in the dialog.

Usage

gtkDialogNewWithButtons(title = NULL, parent = NULL, flags = 0, ..., show = TRUE)

Arguments

title
Title of the dialog, or NULL. [ allow-none ]
parent
Transient parent of the dialog, or NULL. [ allow-none ]
flags
...
a new GtkDialog

Value

GtkWidget] a new GtkDialog

Details

Here's a simple example:
# Explicit
dialog <-
  gtkDialogNewWithButtons("My dialog", main_app_window,
                          c("modal", "destroy-with-parent"), 
                          "gtk-ok", GtkResponseType["accept"], 
                          "gtk-cancel", GtkResponseType["reject"])
## Also via collapsed constructor
dialog <- gtkDialog("My dialog", main_app_window,
                    c("modal", "destroy-with-parent"), 
                    "gtk-ok", GtkResponseType["accept"], 
                    "gtk-cancel", GtkResponseType["reject"])