mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 16:10:41 -05:00
add code to create big stacks of dialogs transient for each other, for
2002-10-17 Havoc Pennington <hp@redhat.com> * src/tools/metacity-window-demo.c (dialog_cb): add code to create big stacks of dialogs transient for each other, for testing.
This commit is contained in:
parent
337812d51d
commit
aa62466091
@ -1,3 +1,8 @@
|
|||||||
|
2002-10-17 Havoc Pennington <hp@redhat.com>
|
||||||
|
|
||||||
|
* src/tools/metacity-window-demo.c (dialog_cb): add code to create
|
||||||
|
big stacks of dialogs transient for each other, for testing.
|
||||||
|
|
||||||
2002-10-16 Havoc Pennington <hp@redhat.com>
|
2002-10-16 Havoc Pennington <hp@redhat.com>
|
||||||
|
|
||||||
* src/workspace.c: workspaces are all per-screen now, fix
|
* src/workspace.c: workspaces are all per-screen now, fix
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2001 Havoc Pennington
|
* Copyright (C) 2001 Havoc Pennington
|
||||||
|
* Copyright (C) 2002 Red Hat, Inc.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License as
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
@ -216,27 +216,66 @@ main (int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
dialog_cb (gpointer callback_data,
|
response_cb (GtkDialog *dialog,
|
||||||
guint callback_action,
|
int response_id,
|
||||||
GtkWidget *widget)
|
void *data);
|
||||||
|
|
||||||
|
static void
|
||||||
|
make_dialog (GtkWidget *parent,
|
||||||
|
int depth)
|
||||||
{
|
{
|
||||||
GtkWidget *dialog;
|
GtkWidget *dialog;
|
||||||
|
|
||||||
dialog = gtk_message_dialog_new (GTK_WINDOW (callback_data),
|
dialog = gtk_message_dialog_new (GTK_WINDOW (parent),
|
||||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||||
GTK_MESSAGE_INFO,
|
GTK_MESSAGE_INFO,
|
||||||
GTK_BUTTONS_CLOSE,
|
GTK_BUTTONS_CLOSE,
|
||||||
"Here is a dialog");
|
"Here is a dialog %d",
|
||||||
|
depth);
|
||||||
|
|
||||||
|
gtk_dialog_add_button (GTK_DIALOG (dialog),
|
||||||
|
"Open child dialog",
|
||||||
|
GTK_RESPONSE_ACCEPT);
|
||||||
|
|
||||||
/* Close dialog on user response */
|
/* Close dialog on user response */
|
||||||
g_signal_connect (G_OBJECT (dialog),
|
g_signal_connect (G_OBJECT (dialog),
|
||||||
"response",
|
"response",
|
||||||
G_CALLBACK (gtk_widget_destroy),
|
G_CALLBACK (response_cb),
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
g_object_set_data (G_OBJECT (dialog), "depth",
|
||||||
|
GINT_TO_POINTER (depth));
|
||||||
|
|
||||||
gtk_widget_show (dialog);
|
gtk_widget_show (dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
response_cb (GtkDialog *dialog,
|
||||||
|
int response_id,
|
||||||
|
void *data)
|
||||||
|
{
|
||||||
|
switch (response_id)
|
||||||
|
{
|
||||||
|
case GTK_RESPONSE_ACCEPT:
|
||||||
|
make_dialog (GTK_WIDGET (dialog),
|
||||||
|
GPOINTER_TO_INT (g_object_get_data (G_OBJECT (dialog),
|
||||||
|
"depth")) + 1);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
gtk_widget_destroy (GTK_WIDGET (dialog));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
dialog_cb (gpointer callback_data,
|
||||||
|
guint callback_action,
|
||||||
|
GtkWidget *widget)
|
||||||
|
{
|
||||||
|
make_dialog (GTK_WIDGET (callback_data), 1);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
modal_dialog_cb (gpointer callback_data,
|
modal_dialog_cb (gpointer callback_data,
|
||||||
guint callback_action,
|
guint callback_action,
|
||||||
|
Loading…
Reference in New Issue
Block a user