gtkDialogNewWithButtons {RGtk2}R Documentation

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 [character] Title of the dialog, or NULL
parent [GtkWindow] Transient parent of the dialog, or NULL
flags [GtkDialogFlags] from GtkDialogFlags
... response ID for first button, then additional buttons, ending with NULL

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"])

Value

[GtkWidget] a new GtkDialog

Author(s)

Derived by RGtkGen from GTK+ documentation


[Package RGtk2 version 2.12.5-3 Index]