gtkDialogNewWithButtons: gtkDialogNewWithButtons

Description Usage Arguments Details Value Author(s)

View source: R/gtkManuals.R

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

1
2
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

from GtkDialogFlags

...

a new GtkDialog

Details

Here's a simple example:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# 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


RGtk2 documentation built on Oct. 14, 2021, 5:08 p.m.