Dialog
Object Hierarchy:
Description:
Granite.Dialog is a styled Gtk.Dialog that uses an empty title area and action widgets in the bottom/end position.
Example
var header = new Granite.HeaderLabel ("Header");
var entry = new Gtk.Entry ();
var gtk_switch = new Gtk.Switch () {
halign = Gtk.Align.START
};
var layout = new Gtk.Grid () {
row_spacing = 12
};
layout.attach (header, 0, 1);
layout.attach (entry, 0, 2);
layout.attach (gtk_switch, 0, 3);
var dialog = new Granite.Dialog () {
transient_for = window
};
dialog.content_area.add (layout);
dialog.add_button ("Cancel", Gtk.ResponseType.CANCEL);
var suggested_button = dialog.add_button ("Suggested Action", Gtk.ResponseType.ACCEPT);
suggested_button.get_style_context ().add_class (Gtk.STYLE_CLASS_SUGGESTED_ACTION);
dialog.show_all ();
dialog.response.connect ((response_id) => {
if (response_id == Gtk.ResponseType.ACCEPT) {
// Do Something
}
dialog.destroy ();
});
All known sub-classes:
Namespace: Granite
Package: granite-7
Content:
Creation methods:
Methods:
Inherited Members:
All known members inherited from class Gtk.Dialog
All known members inherited from class Gtk.Window
All known members inherited from class Gtk.Widget
All known members inherited from class GLib.Object
All known members inherited from interface Gtk.Accessible
All known members inherited from interface Gtk.Buildable
All known members inherited from interface Gtk.Native
All known members inherited from interface Gtk.Root
All known members inherited from interface Gtk.ShortcutManager