Dialog


Object Hierarchy:

Granite.Dialog Granite.Dialog Granite.Dialog Gtk.Dialog Gtk.Dialog Gtk.Dialog->Granite.Dialog Gtk.Window Gtk.Window Gtk.Window->Gtk.Dialog Gtk.Widget Gtk.Widget Gtk.Widget->Gtk.Window GLib.InitiallyUnowned GLib.InitiallyUnowned GLib.InitiallyUnowned->Gtk.Widget GLib.Object GLib.Object GLib.Object->GLib.InitiallyUnowned Gtk.Accessible Gtk.Accessible Gtk.Accessible->Gtk.Dialog Gtk.Accessible->Gtk.Window Gtk.Accessible->Gtk.Widget Gtk.Buildable Gtk.Buildable Gtk.Buildable->Gtk.Dialog Gtk.Buildable->Gtk.Window Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget Gtk.ConstraintTarget Gtk.ConstraintTarget->Gtk.Dialog Gtk.ConstraintTarget->Gtk.Window Gtk.ConstraintTarget->Gtk.Widget Gtk.Native Gtk.Native Gtk.Native->Gtk.Dialog Gtk.Native->Gtk.Window Gtk.Root Gtk.Root Gtk.Root->Gtk.Dialog Gtk.Root->Gtk.Window Gtk.ShortcutManager Gtk.ShortcutManager Gtk.ShortcutManager->Gtk.Dialog Gtk.ShortcutManager->Gtk.Window

Description:


public class Dialog : Dialog

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.Widget
All known members inherited from interface Gtk.Native
All known members inherited from interface Gtk.Root
All known members inherited from interface Gtk.ShortcutManager