Commit 9c0bc41a authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

Call the do_ functions with the toplevel as argument.

Sat Nov  8 23:06:02 2003  Matthias Clasen  <maclas@gmx.de>

	* demos/gtk-demo/main.c (row_activated_cb): Call the do_
	functions with the toplevel as argument.

	* demos/gtk-demo/geninclude.pl.in: Change the signature
	of GDoDemoFunc to take a widget argument

	* demos/gtk-demo/ui_manager.c (do_ui_manager):
	* demos/gtk-demo/tree_store.c (do_tree_store):
	* demos/gtk-demo/textview.c (do_textview):
	* demos/gtk-demo/stock_browser.c (do_stock_browser):
	* demos/gtk-demo/sizegroup.c (do_sizegroup):
	* demos/gtk-demo/pixbufs.c (do_pixbufs):
	* demos/gtk-demo/panes.c (do_panes):
	* demos/gtk-demo/menus.c (do_menus):
	* demos/gtk-demo/list_store.c (do_list_store):
	* demos/gtk-demo/images.c (do_images):
	* demos/gtk-demo/hypertext.c (do_hypertext):
	* demos/gtk-demo/editable_cells.c (do_editable_cells):
	* demos/gtk-demo/drawingarea.c (do_drawingarea):
	* demos/gtk-demo/dialog.c (do_dialog):
	* demos/gtk-demo/colorsel.c (do_colorsel):
	* demos/gtk-demo/changedisplay.c (do_changedisplay):
	* demos/gtk-demo/button_box.c (do_button_box):
	* demos/gtk-demo/appwindow.c (do_appwindow): Take a widget
	as argument, and make new windows or dialogs appear on the
	same screen.  (#80388)
parent 035b3f32
Sat Nov 8 23:06:02 2003 Matthias Clasen <maclas@gmx.de>
* demos/gtk-demo/main.c (row_activated_cb): Call the do_
functions with the toplevel as argument.
* demos/gtk-demo/geninclude.pl.in: Change the signature
of GDoDemoFunc to take a widget argument
* demos/gtk-demo/ui_manager.c (do_ui_manager):
* demos/gtk-demo/tree_store.c (do_tree_store):
* demos/gtk-demo/textview.c (do_textview):
* demos/gtk-demo/stock_browser.c (do_stock_browser):
* demos/gtk-demo/sizegroup.c (do_sizegroup):
* demos/gtk-demo/pixbufs.c (do_pixbufs):
* demos/gtk-demo/panes.c (do_panes):
* demos/gtk-demo/menus.c (do_menus):
* demos/gtk-demo/list_store.c (do_list_store):
* demos/gtk-demo/images.c (do_images):
* demos/gtk-demo/hypertext.c (do_hypertext):
* demos/gtk-demo/editable_cells.c (do_editable_cells):
* demos/gtk-demo/drawingarea.c (do_drawingarea):
* demos/gtk-demo/dialog.c (do_dialog):
* demos/gtk-demo/colorsel.c (do_colorsel):
* demos/gtk-demo/changedisplay.c (do_changedisplay):
* demos/gtk-demo/button_box.c (do_button_box):
* demos/gtk-demo/appwindow.c (do_appwindow): Take a widget
as argument, and make new windows or dialogs appear on the
same screen. (#80388)
Sat Nov 8 21:59:30 2003 Matthias Clasen <maclas@gmx.de>
* gtk/gtkeventbox.c (gtk_event_box_class_init): Let
......
Sat Nov 8 23:06:02 2003 Matthias Clasen <maclas@gmx.de>
* demos/gtk-demo/main.c (row_activated_cb): Call the do_
functions with the toplevel as argument.
* demos/gtk-demo/geninclude.pl.in: Change the signature
of GDoDemoFunc to take a widget argument
* demos/gtk-demo/ui_manager.c (do_ui_manager):
* demos/gtk-demo/tree_store.c (do_tree_store):
* demos/gtk-demo/textview.c (do_textview):
* demos/gtk-demo/stock_browser.c (do_stock_browser):
* demos/gtk-demo/sizegroup.c (do_sizegroup):
* demos/gtk-demo/pixbufs.c (do_pixbufs):
* demos/gtk-demo/panes.c (do_panes):
* demos/gtk-demo/menus.c (do_menus):
* demos/gtk-demo/list_store.c (do_list_store):
* demos/gtk-demo/images.c (do_images):
* demos/gtk-demo/hypertext.c (do_hypertext):
* demos/gtk-demo/editable_cells.c (do_editable_cells):
* demos/gtk-demo/drawingarea.c (do_drawingarea):
* demos/gtk-demo/dialog.c (do_dialog):
* demos/gtk-demo/colorsel.c (do_colorsel):
* demos/gtk-demo/changedisplay.c (do_changedisplay):
* demos/gtk-demo/button_box.c (do_button_box):
* demos/gtk-demo/appwindow.c (do_appwindow): Take a widget
as argument, and make new windows or dialogs appear on the
same screen. (#80388)
Sat Nov 8 21:59:30 2003 Matthias Clasen <maclas@gmx.de>
* gtk/gtkeventbox.c (gtk_event_box_class_init): Let
......
Sat Nov 8 23:06:02 2003 Matthias Clasen <maclas@gmx.de>
* demos/gtk-demo/main.c (row_activated_cb): Call the do_
functions with the toplevel as argument.
* demos/gtk-demo/geninclude.pl.in: Change the signature
of GDoDemoFunc to take a widget argument
* demos/gtk-demo/ui_manager.c (do_ui_manager):
* demos/gtk-demo/tree_store.c (do_tree_store):
* demos/gtk-demo/textview.c (do_textview):
* demos/gtk-demo/stock_browser.c (do_stock_browser):
* demos/gtk-demo/sizegroup.c (do_sizegroup):
* demos/gtk-demo/pixbufs.c (do_pixbufs):
* demos/gtk-demo/panes.c (do_panes):
* demos/gtk-demo/menus.c (do_menus):
* demos/gtk-demo/list_store.c (do_list_store):
* demos/gtk-demo/images.c (do_images):
* demos/gtk-demo/hypertext.c (do_hypertext):
* demos/gtk-demo/editable_cells.c (do_editable_cells):
* demos/gtk-demo/drawingarea.c (do_drawingarea):
* demos/gtk-demo/dialog.c (do_dialog):
* demos/gtk-demo/colorsel.c (do_colorsel):
* demos/gtk-demo/changedisplay.c (do_changedisplay):
* demos/gtk-demo/button_box.c (do_button_box):
* demos/gtk-demo/appwindow.c (do_appwindow): Take a widget
as argument, and make new windows or dialogs appear on the
same screen. (#80388)
Sat Nov 8 21:59:30 2003 Matthias Clasen <maclas@gmx.de>
* gtk/gtkeventbox.c (gtk_event_box_class_init): Let
......
Sat Nov 8 23:06:02 2003 Matthias Clasen <maclas@gmx.de>
* demos/gtk-demo/main.c (row_activated_cb): Call the do_
functions with the toplevel as argument.
* demos/gtk-demo/geninclude.pl.in: Change the signature
of GDoDemoFunc to take a widget argument
* demos/gtk-demo/ui_manager.c (do_ui_manager):
* demos/gtk-demo/tree_store.c (do_tree_store):
* demos/gtk-demo/textview.c (do_textview):
* demos/gtk-demo/stock_browser.c (do_stock_browser):
* demos/gtk-demo/sizegroup.c (do_sizegroup):
* demos/gtk-demo/pixbufs.c (do_pixbufs):
* demos/gtk-demo/panes.c (do_panes):
* demos/gtk-demo/menus.c (do_menus):
* demos/gtk-demo/list_store.c (do_list_store):
* demos/gtk-demo/images.c (do_images):
* demos/gtk-demo/hypertext.c (do_hypertext):
* demos/gtk-demo/editable_cells.c (do_editable_cells):
* demos/gtk-demo/drawingarea.c (do_drawingarea):
* demos/gtk-demo/dialog.c (do_dialog):
* demos/gtk-demo/colorsel.c (do_colorsel):
* demos/gtk-demo/changedisplay.c (do_changedisplay):
* demos/gtk-demo/button_box.c (do_button_box):
* demos/gtk-demo/appwindow.c (do_appwindow): Take a widget
as argument, and make new windows or dialogs appear on the
same screen. (#80388)
Sat Nov 8 21:59:30 2003 Matthias Clasen <maclas@gmx.de>
* gtk/gtkeventbox.c (gtk_event_box_class_init): Let
......
Sat Nov 8 23:06:02 2003 Matthias Clasen <maclas@gmx.de>
* demos/gtk-demo/main.c (row_activated_cb): Call the do_
functions with the toplevel as argument.
* demos/gtk-demo/geninclude.pl.in: Change the signature
of GDoDemoFunc to take a widget argument
* demos/gtk-demo/ui_manager.c (do_ui_manager):
* demos/gtk-demo/tree_store.c (do_tree_store):
* demos/gtk-demo/textview.c (do_textview):
* demos/gtk-demo/stock_browser.c (do_stock_browser):
* demos/gtk-demo/sizegroup.c (do_sizegroup):
* demos/gtk-demo/pixbufs.c (do_pixbufs):
* demos/gtk-demo/panes.c (do_panes):
* demos/gtk-demo/menus.c (do_menus):
* demos/gtk-demo/list_store.c (do_list_store):
* demos/gtk-demo/images.c (do_images):
* demos/gtk-demo/hypertext.c (do_hypertext):
* demos/gtk-demo/editable_cells.c (do_editable_cells):
* demos/gtk-demo/drawingarea.c (do_drawingarea):
* demos/gtk-demo/dialog.c (do_dialog):
* demos/gtk-demo/colorsel.c (do_colorsel):
* demos/gtk-demo/changedisplay.c (do_changedisplay):
* demos/gtk-demo/button_box.c (do_button_box):
* demos/gtk-demo/appwindow.c (do_appwindow): Take a widget
as argument, and make new windows or dialogs appear on the
same screen. (#80388)
Sat Nov 8 21:59:30 2003 Matthias Clasen <maclas@gmx.de>
* gtk/gtkeventbox.c (gtk_event_box_class_init): Let
......
......@@ -300,7 +300,7 @@ update_resize_grip (GtkWidget *widget,
GtkWidget *
do_appwindow (void)
do_appwindow (GtkWidget *do_widget)
{
if (!window)
{
......@@ -320,6 +320,8 @@ do_appwindow (void)
*/
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Application Window");
/* NULL window variable when window is closed */
......
......@@ -41,7 +41,7 @@ create_bbox (gint horizontal,
}
GtkWidget *
do_button_box (void)
do_button_box (GtkWidget *do_widget)
{
static GtkWidget *window = NULL;
GtkWidget *main_vbox;
......@@ -53,6 +53,8 @@ do_button_box (void)
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Button Boxes");
g_signal_connect (window, "destroy",
......
......@@ -577,7 +577,7 @@ destroy_cb (GtkObject *object,
* it. Otherwise, destroys it.
*/
GtkWidget *
do_changedisplay (void)
do_changedisplay (GtkWidget *do_widget)
{
static ChangeDisplayInfo *info = NULL;
......@@ -589,7 +589,7 @@ do_changedisplay (void)
info = g_new0 (ChangeDisplayInfo, 1);
info->window = gtk_dialog_new_with_buttons ("Change Screen or display",
NULL, /* parent */
GTK_WINDOW (do_widget),
GTK_DIALOG_NO_SEPARATOR,
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
"Change", GTK_RESPONSE_OK,
......
......@@ -65,7 +65,7 @@ change_color_callback (GtkWidget *button,
}
GtkWidget *
do_colorsel (void)
do_colorsel (GtkWidget *do_widget)
{
GtkWidget *vbox;
GtkWidget *button;
......@@ -78,6 +78,8 @@ do_colorsel (void)
color.green = 0;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Color Selection");
g_signal_connect (window, "destroy",
......
......@@ -93,7 +93,7 @@ interactive_dialog_clicked (GtkButton *button,
}
GtkWidget *
do_dialog (void)
do_dialog (GtkWidget *do_widget)
{
GtkWidget *frame;
GtkWidget *vbox;
......@@ -106,6 +106,8 @@ do_dialog (void)
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Dialogs");
g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window);
......
......@@ -219,7 +219,7 @@ checkerboard_expose (GtkWidget *da,
}
GtkWidget *
do_drawingarea (void)
do_drawingarea (GtkWidget *do_widget)
{
GtkWidget *frame;
GtkWidget *vbox;
......@@ -229,6 +229,8 @@ do_drawingarea (void)
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Drawing Area");
g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window);
......
......@@ -223,7 +223,7 @@ add_columns (GtkTreeView *treeview)
}
GtkWidget *
do_editable_cells (void)
do_editable_cells (GtkWidget *do_widget)
{
if (!window)
{
......@@ -236,6 +236,8 @@ do_editable_cells (void)
/* create window, etc */
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Shopping list");
gtk_container_set_border_width (GTK_CONTAINER (window), 5);
g_signal_connect (window, "destroy",
......
#!@PERL@ -w
print <<EOT;
typedef GtkWidget *(*GDoDemoFunc) (void);
typedef GtkWidget *(*GDoDemoFunc) (GtkWidget *do_widget);
typedef struct _Demo Demo;
......@@ -27,7 +27,7 @@ for $file (@ARGV) {
close INFO_FILE;
print "GtkWidget *do_$basename (void);\n";
print "GtkWidget *do_$basename (GtkWidget *do_widget);\n";
push @demos, {"title" => $title, "file" => $file,
"func" => "do_$basename"};
......
/* Text Widget/Hypertext
*
* Usually, tags modify the appearance of text in the view, e.g. making it bold or colored or underlined.
* But tags are not restricted to appearance. They can also affect the behavior of mouse and key presses,
* as this demo shows.
* Usually, tags modify the appearance of text in the view, e.g. making it
* bold or colored or underlined. But tags are not restricted to appearance.
* They can also affect the behavior of mouse and key presses, as this demo
* shows.
*/
#include <gtk/gtk.h>
......@@ -252,7 +253,7 @@ visibility_notify_event (GtkWidget *text_view,
}
GtkWidget *
do_hypertext (void)
do_hypertext (GtkWidget *do_widget)
{
static GtkWidget *window = NULL;
......@@ -266,6 +267,8 @@ do_hypertext (void)
regular_cursor = gdk_cursor_new (GDK_XTERM);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
gtk_window_set_default_size (GTK_WINDOW (window),
450, 450);
......
......@@ -307,7 +307,7 @@ toggle_sensitivity_callback (GtkWidget *togglebutton,
GtkWidget *
do_images (void)
do_images (GtkWidget *do_widget)
{
GtkWidget *frame;
GtkWidget *vbox;
......@@ -322,6 +322,8 @@ do_images (void)
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Images");
g_signal_connect (window, "destroy",
......
......@@ -155,7 +155,7 @@ add_columns (GtkTreeView *treeview)
}
GtkWidget *
do_list_store (void)
do_list_store (GtkWidget *do_widget)
{
if (!window)
{
......@@ -167,6 +167,8 @@ do_list_store (void)
/* create window, etc */
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "GtkListStore demo");
g_signal_connect (window, "destroy",
......
......@@ -604,7 +604,7 @@ row_activated_cb (GtkTreeView *tree_view,
&iter,
ITALIC_COLUMN, !italic,
-1);
window = (func) ();
window = (func) (gtk_widget_get_toplevel (GTK_WIDGET (tree_view)));
if (window != NULL)
{
......
......@@ -71,7 +71,7 @@ create_menu (gint depth,
}
GtkWidget *
do_menus (void)
do_menus (GtkWidget *do_widget)
{
static GtkWidget *window = NULL;
GtkWidget *box1;
......@@ -86,7 +86,8 @@ do_menus (void)
GtkAccelGroup *accel_group;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
g_signal_connect (window, "destroy",
G_CALLBACK(gtk_widget_destroyed), &window);
g_signal_connect (window, "delete-event",
......
......@@ -112,7 +112,7 @@ create_pane_options (GtkPaned *paned,
}
GtkWidget *
do_panes (void)
do_panes (GtkWidget *do_widget)
{
static GtkWidget *window = NULL;
GtkWidget *frame;
......@@ -124,6 +124,8 @@ do_panes (void)
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
......
......@@ -205,14 +205,15 @@ cleanup_callback (GtkObject *object,
}
GtkWidget *
do_pixbufs (void)
do_pixbufs (GtkWidget *do_widget)
{
if (!window)
{
GError *error;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Pixbufs");
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
......
......@@ -80,7 +80,7 @@ toggle_grouping (GtkToggleButton *check_button,
}
GtkWidget *
do_sizegroup (void)
do_sizegroup (GtkWidget *do_widget)
{
GtkWidget *table;
GtkWidget *frame;
......@@ -103,7 +103,8 @@ do_sizegroup (void)
if (!window)
{
window = gtk_dialog_new_with_buttons ("GtkSizeGroup",
NULL, 0,
GTK_WINDOW (do_widget),
0,
GTK_STOCK_CLOSE,
GTK_RESPONSE_NONE,
NULL);
......
......@@ -400,7 +400,7 @@ label_set_func (GtkTreeViewColumn *tree_column,
}
GtkWidget *
do_stock_browser (void)
do_stock_browser (GtkWidget *do_widget)
{
if (!window)
{
......@@ -417,6 +417,8 @@ do_stock_browser (void)
GtkTreeViewColumn *column;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Stock Icons and Items");
gtk_window_set_default_size (GTK_WINDOW (window), -1, 500);
......
......@@ -438,7 +438,7 @@ attach_widgets (GtkTextView *text_view)
}
GtkWidget *
do_textview (void)
do_textview (GtkWidget *do_widget)
{
static GtkWidget *window = NULL;
......@@ -451,6 +451,8 @@ do_textview (void)
GtkTextBuffer *buffer;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
gtk_window_set_default_size (GTK_WINDOW (window),
450, 450);
......
......@@ -385,7 +385,7 @@ add_columns (GtkTreeView *treeview)
}
GtkWidget *
do_tree_store (void)
do_tree_store (GtkWidget *do_widget)
{
if (!window)
{
......@@ -396,6 +396,8 @@ do_tree_store (void)
/* create window, etc */
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Card planning sheet");
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
......
......@@ -141,7 +141,7 @@ static const gchar *ui_info =
"</ui>";
GtkWidget *
do_ui_manager (void)
do_ui_manager (GtkWidget *do_widget)
{
static GtkWidget *window = NULL;
......@@ -157,6 +157,8 @@ do_ui_manager (void)
GError *error = NULL;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment