Top | ![]() |
![]() |
![]() |
![]() |
GObject ╰── GInitiallyUnowned ╰── GtkWidget ╰── GtkContainer ╰── GtkBin ╰── GtkWindow ╰── PhoshLayerSurface ╰── PhoshSystemModal ╰── PhoshSystemModalDialog ├── PhoshAppAuthPrompt ├── PhoshEndSessionDialog ├── PhoshGtkMountPrompt ├── PhoshNetworkAuthPrompt ├── PhoshPolkitAuthPrompt ├── PhoshRunCommandDialog ╰── PhoshSystemPrompt
The PhoshSystemModalDialog is used as a base class for system modal dialogs
such as PhoshSystemPrompt or PhoshNetworkAuthPrompt. It consists of a title
at the top, a content widget below that and button are at the bottom.
The content widget can be set via
and buttons
to the button area added via phosh_system_modal_dialog_set_content()
.phosh_system_modal_dialog_add_button()
A system modal dialog uses several style classes for consistent layout: ".phosh-system-modal-dialog" for the whole dialog area, ".phosh-system-modal-dialog-title" for the dialog title, ".phosh-system-modal-dialog-content" for the content area and ".phosh-system-modal-dialog-buttons" for the button area.
The content widget and buttons can be specified using type <phosh-dialog-content> and <phosh-dialog-button> type attributes:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
<object class="PhoshSystemModalDialog"/> <child type="phosh-dialog-content"> <object class="GtkBox"> <property name="visible">True</property> <property name="orientation">vertical</property> <child> ... </child> </object> </child> <child type="phosh-dialog-button"> <object class="GtkButton"> <property name="label">Ok</property> ... </object> </child> <child type="phosh-dialog-button"> <object class="GtkButton"> <property name="label">Cancel</property> ... </object> </child> </object> |
GtkWidget *
phosh_system_modal_dialog_new (void
);
Create a new system-modal dialog.
void phosh_system_modal_dialog_set_content (PhoshSystemModalDialog *self
,GtkWidget *content
);
Adds the given widget as the dialog's content area. It is a programming error to set the content more than once.
void phosh_system_modal_dialog_add_button (PhoshSystemModalDialog *self
,GtkWidget *button
,gint position
);
Adds the given button to the dialog's content area at the given position. If
the posiion is -1
the button is appended at the end.
void phosh_system_modal_dialog_set_title (PhoshSystemModalDialog *self
,const gchar *title
);
void phosh_system_modal_dialog_remove_button (PhoshSystemModalDialog *self
,GtkWidget *button
);
GList *
phosh_system_modal_dialog_get_buttons (PhoshSystemModalDialog *self
);
#define PHOSH_TYPE_SYSTEM_MODAL_DIALOG (phosh_system_modal_dialog_get_type ())
struct PhoshSystemModalDialogClass { PhoshSystemModalClass parent_class; };
“dialog-canceled”
signalvoid user_function (PhoshSystemModalDialog *phoshsystemmodaldialog, gpointer user_data)
The ::dialog-done signal is emitted when the dialog was canceled and should be hidden or destroyed.
Flags: Run Last