From ced833fdfc548c646f9273795b4147037922f2ae Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Fri, 8 Feb 2002 06:22:24 +0000 Subject: [PATCH] add modal dialog test 2002-02-08 Havoc Pennington * src/tools/metacity-window-demo.c (menu_items): add modal dialog test --- ChangeLog | 4 ++++ src/tools/metacity-window-demo.c | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/ChangeLog b/ChangeLog index bcafd7509..7babea3a6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2002-02-08 Havoc Pennington + + * src/tools/metacity-window-demo.c (menu_items): add modal dialog test + 2002-02-08 Havoc Pennington * src/window.c (meta_window_show): when mapping a window with diff --git a/src/tools/metacity-window-demo.c b/src/tools/metacity-window-demo.c index 9e8737169..a0ac65725 100644 --- a/src/tools/metacity-window-demo.c +++ b/src/tools/metacity-window-demo.c @@ -184,6 +184,26 @@ dialog_cb (gpointer callback_data, gtk_widget_show (dialog); } +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, @@ -420,6 +440,7 @@ static GtkItemFactoryEntry menu_items[] = { "/_Windows", NULL, NULL, 0, "" }, { "/Windows/tearoff", NULL, NULL, 0, "" }, { "/Windows/_Dialog", "d", dialog_cb, 0, NULL }, + { "/Windows/_Modal dialog", NULL, modal_dialog_cb, 0, NULL }, { "/Windows/_Utility", "u", utility_cb, 0, NULL }, { "/Windows/_Splashscreen", "s", splashscreen_cb, 0, NULL }, { "/Windows/_Top dock", NULL, dock_cb, DOCK_TOP, NULL },