summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>2002-02-08 06:22:24 +0000
committerHavoc Pennington <hp@src.gnome.org>2002-02-08 06:22:24 +0000
commitced833fdfc548c646f9273795b4147037922f2ae (patch)
tree98ae898b6c28c09a43558463a0dcbd1c5ce8af06 /src/tools
parent51d9f9dce63404f6c74a15d874a105726fdc95f4 (diff)
downloadmetacity-ced833fdfc548c646f9273795b4147037922f2ae.tar.gz
metacity-ced833fdfc548c646f9273795b4147037922f2ae.tar.bz2
add modal dialog test
2002-02-08 Havoc Pennington <hp@pobox.com> * src/tools/metacity-window-demo.c (menu_items): add modal dialog test
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/metacity-window-demo.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/tools/metacity-window-demo.c b/src/tools/metacity-window-demo.c
index 9e87371..a0ac657 100644
--- a/src/tools/metacity-window-demo.c
+++ b/src/tools/metacity-window-demo.c
@@ -185,6 +185,26 @@ dialog_cb (gpointer callback_data,
}
static void
+modal_dialog_cb (gpointer callback_data,
+ guint callback_action,
+ GtkWidget *widget)
+{
+ GtkWidget *dialog;
+
+ dialog = gtk_message_dialog_new (GTK_WINDOW (callback_data),
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_INFO,
+ GTK_BUTTONS_CLOSE,
+ "Here is a MODAL dialog");
+
+ set_gtk_window_type (GTK_WINDOW (dialog), "_NET_WM_WINDOW_TYPE_MODAL_DIALOG");
+
+ gtk_dialog_run (GTK_DIALOG (dialog));
+
+ gtk_widget_destroy (dialog);
+}
+
+static void
utility_cb (gpointer callback_data,
guint callback_action,
GtkWidget *widget)
@@ -420,6 +440,7 @@ static GtkItemFactoryEntry menu_items[] =
{ "/_Windows", NULL, NULL, 0, "<Branch>" },
{ "/Windows/tearoff", NULL, NULL, 0, "<Tearoff>" },
{ "/Windows/_Dialog", "<control>d", dialog_cb, 0, NULL },
+ { "/Windows/_Modal dialog", NULL, modal_dialog_cb, 0, NULL },
{ "/Windows/_Utility", "<control>u", utility_cb, 0, NULL },
{ "/Windows/_Splashscreen", "<control>s", splashscreen_cb, 0, NULL },
{ "/Windows/_Top dock", NULL, dock_cb, DOCK_TOP, NULL },