Commit 58b5405b authored by Owen Taylor's avatar Owen Taylor

at Oct 20 19:38:16 2001 Owen Taylor <otaylor@redhat.com>

        * demos/*.c demos/gdk-pixbuf/*.c: Eliminate gtk_signal_*
        in favor of g_signal_*, gtk_object_* in favor of
        g_object_*.
parent 88c9fe38
Sat Oct 20 19:38:16 2001 Owen Taylor <otaylor@redhat.com>
* demos/*.c demos/gdk-pixbuf/*.c: Eliminate gtk_signal_*
in favor of g_signal_*, gtk_object_* in favor of
g_object_*.
Fri Oct 19 18:35:22 2001 Manish Singh <yosh@gimp.org>
* gtk/{gtkentry.c,gtktextview.c}: since GtkIMContext derives directly
......
Sat Oct 20 19:38:16 2001 Owen Taylor <otaylor@redhat.com>
* demos/*.c demos/gdk-pixbuf/*.c: Eliminate gtk_signal_*
in favor of g_signal_*, gtk_object_* in favor of
g_object_*.
Fri Oct 19 18:35:22 2001 Manish Singh <yosh@gimp.org>
* gtk/{gtkentry.c,gtktextview.c}: since GtkIMContext derives directly
......
Sat Oct 20 19:38:16 2001 Owen Taylor <otaylor@redhat.com>
* demos/*.c demos/gdk-pixbuf/*.c: Eliminate gtk_signal_*
in favor of g_signal_*, gtk_object_* in favor of
g_object_*.
Fri Oct 19 18:35:22 2001 Manish Singh <yosh@gimp.org>
* gtk/{gtkentry.c,gtktextview.c}: since GtkIMContext derives directly
......
Sat Oct 20 19:38:16 2001 Owen Taylor <otaylor@redhat.com>
* demos/*.c demos/gdk-pixbuf/*.c: Eliminate gtk_signal_*
in favor of g_signal_*, gtk_object_* in favor of
g_object_*.
Fri Oct 19 18:35:22 2001 Manish Singh <yosh@gimp.org>
* gtk/{gtkentry.c,gtktextview.c}: since GtkIMContext derives directly
......
Sat Oct 20 19:38:16 2001 Owen Taylor <otaylor@redhat.com>
* demos/*.c demos/gdk-pixbuf/*.c: Eliminate gtk_signal_*
in favor of g_signal_*, gtk_object_* in favor of
g_object_*.
Fri Oct 19 18:35:22 2001 Manish Singh <yosh@gimp.org>
* gtk/{gtkentry.c,gtktextview.c}: since GtkIMContext derives directly
......
Sat Oct 20 19:38:16 2001 Owen Taylor <otaylor@redhat.com>
* demos/*.c demos/gdk-pixbuf/*.c: Eliminate gtk_signal_*
in favor of g_signal_*, gtk_object_* in favor of
g_object_*.
Fri Oct 19 18:35:22 2001 Manish Singh <yosh@gimp.org>
* gtk/{gtkentry.c,gtktextview.c}: since GtkIMContext derives directly
......
Sat Oct 20 19:38:16 2001 Owen Taylor <otaylor@redhat.com>
* demos/*.c demos/gdk-pixbuf/*.c: Eliminate gtk_signal_*
in favor of g_signal_*, gtk_object_* in favor of
g_object_*.
Fri Oct 19 18:35:22 2001 Manish Singh <yosh@gimp.org>
* gtk/{gtkentry.c,gtktextview.c}: since GtkIMContext derives directly
......
......@@ -220,7 +220,7 @@ do_appwindow (void)
item_factory = gtk_item_factory_new (GTK_TYPE_MENU_BAR, "<main>", accel_group);
/* Set up item factory to go away with the window */
gtk_object_ref (GTK_OBJECT (item_factory));
g_object_ref (item_factory);
gtk_object_sink (GTK_OBJECT (item_factory));
g_object_set_data_full (G_OBJECT (window),
"<main>",
......
......@@ -55,9 +55,9 @@ do_button_box (void)
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Button Boxes");
gtk_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC(gtk_widget_destroyed),
&window);
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
&window);
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
......
......@@ -59,7 +59,8 @@ do_colorsel (void)
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Color Selection");
gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (gtk_widget_destroyed), &window);
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
......@@ -91,9 +92,8 @@ do_colorsel (void)
gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (change_color_callback),
NULL);
g_signal_connect (button, "clicked",
G_CALLBACK (change_color_callback), NULL);
}
if (!GTK_WIDGET_VISIBLE (window))
......
......@@ -108,7 +108,7 @@ do_dialog (void)
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Dialogs");
gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (gtk_widget_destroyed), &window);
g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window);
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
frame = gtk_frame_new ("Dialogs");
......@@ -122,8 +122,8 @@ do_dialog (void)
hbox = gtk_hbox_new (FALSE, 8);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
button = gtk_button_new_with_mnemonic ("_Message Dialog");
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (message_dialog_clicked), NULL);
g_signal_connect (button, "clicked",
G_CALLBACK (message_dialog_clicked), NULL);
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, FALSE, 0);
......@@ -134,8 +134,8 @@ do_dialog (void)
vbox2 = gtk_vbox_new (FALSE, 0);
button = gtk_button_new_with_mnemonic ("_Interactive Dialog");
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (interactive_dialog_clicked), NULL);
g_signal_connect (button, "clicked",
G_CALLBACK (interactive_dialog_clicked), NULL);
gtk_box_pack_start (GTK_BOX (hbox), vbox2, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
......
......@@ -231,7 +231,7 @@ do_drawingarea (void)
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Drawing Area");
gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (gtk_widget_destroyed), &window);
g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window);
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
......@@ -258,10 +258,8 @@ do_drawingarea (void)
gtk_container_add (GTK_CONTAINER (frame), da);
gtk_signal_connect (GTK_OBJECT (da),
"expose_event",
GTK_SIGNAL_FUNC (checkerboard_expose),
NULL);
g_signal_connect (da, "expose_event",
G_CALLBACK (checkerboard_expose), NULL);
/*
* Create the scribble area
......@@ -284,17 +282,17 @@ do_drawingarea (void)
/* Signals used to handle backing pixmap */
gtk_signal_connect (GTK_OBJECT (da), "expose_event",
GTK_SIGNAL_FUNC (scribble_expose_event), NULL);
gtk_signal_connect (GTK_OBJECT (da),"configure_event",
GTK_SIGNAL_FUNC (scribble_configure_event), NULL);
g_signal_connect (da, "expose_event",
G_CALLBACK (scribble_expose_event), NULL);
g_signal_connect (da,"configure_event",
G_CALLBACK (scribble_configure_event), NULL);
/* Event signals */
gtk_signal_connect (GTK_OBJECT (da), "motion_notify_event",
GTK_SIGNAL_FUNC (scribble_motion_notify_event), NULL);
gtk_signal_connect (GTK_OBJECT (da), "button_press_event",
GTK_SIGNAL_FUNC (scribble_button_press_event), NULL);
g_signal_connect (da, "motion_notify_event",
G_CALLBACK (scribble_motion_notify_event), NULL);
g_signal_connect (da, "button_press_event",
G_CALLBACK (scribble_button_press_event), NULL);
/* Ask to receive events the drawing area doesn't normally
......
......@@ -93,10 +93,8 @@ progressive_timeout (gpointer data)
"Failure reading image file 'alphatest.png': %s",
g_strerror (errno));
gtk_signal_connect (GTK_OBJECT (dialog),
"response",
GTK_SIGNAL_FUNC (gtk_widget_destroy),
NULL);
g_signal_connect (dialog, "response",
G_CALLBACK (gtk_widget_destroy), NULL);
fclose (image_stream);
image_stream = NULL;
......@@ -123,10 +121,8 @@ progressive_timeout (gpointer data)
g_error_free (error);
gtk_signal_connect (GTK_OBJECT (dialog),
"response",
GTK_SIGNAL_FUNC (gtk_widget_destroy),
NULL);
g_signal_connect (dialog, "response",
G_CALLBACK (gtk_widget_destroy), NULL);
fclose (image_stream);
image_stream = NULL;
......@@ -162,10 +158,8 @@ progressive_timeout (gpointer data)
g_error_free (error);
gtk_signal_connect (GTK_OBJECT (dialog),
"response",
GTK_SIGNAL_FUNC (gtk_widget_destroy),
NULL);
g_signal_connect (dialog, "response",
G_CALLBACK (gtk_widget_destroy), NULL);
gtk_widget_show (dialog);
......@@ -203,10 +197,8 @@ progressive_timeout (gpointer data)
"Unable to open image file 'alphatest.png': %s",
g_strerror (errno));
gtk_signal_connect (GTK_OBJECT (dialog),
"response",
GTK_SIGNAL_FUNC (gtk_widget_destroy),
NULL);
g_signal_connect (dialog, "response",
G_CALLBACK (gtk_widget_destroy), NULL);
gtk_widget_show (dialog);
......@@ -224,15 +216,11 @@ progressive_timeout (gpointer data)
pixbuf_loader = gdk_pixbuf_loader_new ();
g_signal_connect (G_OBJECT (pixbuf_loader),
"area_prepared",
G_CALLBACK (progressive_prepared_callback),
image);
g_signal_connect (G_OBJECT (pixbuf_loader), "area_prepared",
G_CALLBACK (progressive_prepared_callback), image);
g_signal_connect (G_OBJECT (pixbuf_loader),
"area_updated",
G_CALLBACK (progressive_updated_callback),
image);
g_signal_connect (G_OBJECT (pixbuf_loader), "area_updated",
G_CALLBACK (progressive_updated_callback), image);
}
/* leave timeout installed */
......@@ -290,8 +278,10 @@ do_images (void)
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Images");
gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (gtk_widget_destroyed), &window);
gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (cleanup_callback), NULL);
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
g_signal_connect (window, "destroy",
G_CALLBACK (cleanup_callback), NULL);
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
......@@ -341,10 +331,8 @@ do_images (void)
error->message);
g_error_free (error);
gtk_signal_connect (GTK_OBJECT (dialog),
"response",
GTK_SIGNAL_FUNC (gtk_widget_destroy),
NULL);
g_signal_connect (dialog, "response",
G_CALLBACK (gtk_widget_destroy), NULL);
gtk_widget_show (dialog);
}
......
......@@ -59,19 +59,15 @@ do_item_factory (void)
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC(gtk_widget_destroyed),
&window);
gtk_signal_connect (GTK_OBJECT (window), "delete-event",
GTK_SIGNAL_FUNC (gtk_true),
NULL);
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
g_signal_connect (window, "delete-event",
G_CALLBACK (gtk_true), NULL);
accel_group = gtk_accel_group_new ();
item_factory = gtk_item_factory_new (GTK_TYPE_MENU_BAR, "<main>", accel_group);
gtk_object_set_data_full (GTK_OBJECT (window),
"<main>",
item_factory,
(GtkDestroyNotify) gtk_object_unref);
g_object_set_data_full (G_OBJECT (window), "<main>",
item_factory, (GDestroyNotify) g_object_unref);
gtk_accel_group_attach (accel_group, G_OBJECT (window));
gtk_window_set_title (GTK_WINDOW (window), "Item Factory");
gtk_container_set_border_width (GTK_CONTAINER (window), 0);
......@@ -106,9 +102,8 @@ do_item_factory (void)
gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, TRUE, 0);
button = gtk_button_new_with_label ("close");
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC(gtk_widget_destroy),
GTK_OBJECT (window));
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (gtk_widget_destroy), window);
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_widget_grab_default (button);
......
......@@ -554,10 +554,8 @@ button_press_event_cb (GtkTreeView *tree_view,
cbdata->model = model;
cbdata->path = path;
gtk_signal_connect (GTK_OBJECT (window),
"destroy",
GTK_SIGNAL_FUNC (window_closed_cb),
cbdata);
g_signal_connect (window, "destroy",
G_CALLBACK (window_closed_cb), cbdata);
}
else
{
......@@ -568,8 +566,7 @@ button_press_event_cb (GtkTreeView *tree_view,
gtk_tree_path_free (path);
}
gtk_signal_emit_stop_by_name (GTK_OBJECT (tree_view),
"button_press_event");
g_signal_stop_emission_by_name (tree_view, "button_press_event");
return TRUE;
}
......@@ -612,10 +609,8 @@ row_activated_cb (GtkTreeView *tree_view,
cbdata->model = model;
cbdata->path = gtk_tree_path_copy (path);
gtk_signal_connect (GTK_OBJECT (window),
"destroy",
GTK_SIGNAL_FUNC (window_closed_cb),
cbdata);
g_signal_connect (window, "destroy",
G_CALLBACK (window_closed_cb), cbdata);
}
}
}
......@@ -760,8 +755,8 @@ create_tree (void)
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view),
GTK_TREE_VIEW_COLUMN (column));
g_signal_connect (G_OBJECT (selection), "changed", GTK_SIGNAL_FUNC (selection_cb), model);
g_signal_connect (G_OBJECT (tree_view), "row_activated", GTK_SIGNAL_FUNC (row_activated_cb), model);
g_signal_connect (selection, "changed", G_CALLBACK (selection_cb), model);
g_signal_connect (tree_view, "row_activated", G_CALLBACK (row_activated_cb), model);
gtk_tree_view_expand_all (GTK_TREE_VIEW (tree_view));
......@@ -801,10 +796,8 @@ setup_default_icon (void)
err->message);
g_error_free (err);
gtk_signal_connect (GTK_OBJECT (dialog),
"response",
GTK_SIGNAL_FUNC (gtk_widget_destroy),
NULL);
g_signal_connect (dialog, "response",
G_CALLBACK (gtk_widget_destroy), NULL);
}
}
......@@ -852,8 +845,8 @@ main (int argc, char **argv)
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "GTK+ Code Demos");
gtk_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC (gtk_main_quit), NULL);
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_main_quit), NULL);
hbox = gtk_hbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (window), hbox);
......
......@@ -92,12 +92,10 @@ do_menus (void)
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC(gtk_widget_destroyed),
&window);
gtk_signal_connect (GTK_OBJECT (window), "delete-event",
GTK_SIGNAL_FUNC (gtk_true),
NULL);
g_signal_connect (window, "destroy",
G_CALLBACK(gtk_widget_destroyed), &window);
g_signal_connect (window, "delete-event",
G_CALLBACK (gtk_true), NULL);
accel_group = gtk_accel_group_new ();
gtk_accel_group_attach (accel_group, G_OBJECT (window));
......@@ -195,9 +193,8 @@ do_menus (void)
gtk_widget_show (box2);
button = gtk_button_new_with_label ("close");
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC(gtk_widget_destroy),
GTK_OBJECT (window));
g_signal_connect_swapped (button, "clicked",
G_CALLBACK(gtk_widget_destroy), window);
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_widget_grab_default (button);
......
......@@ -77,18 +77,16 @@ create_pane_options (GtkPaned *paned,
check_button = gtk_check_button_new_with_mnemonic ("_Resize");
gtk_table_attach_defaults (GTK_TABLE (table), check_button,
0, 1, 1, 2);
gtk_signal_connect (GTK_OBJECT (check_button), "toggled",
GTK_SIGNAL_FUNC (toggle_resize),
paned->child1);
g_signal_connect (check_button, "toggled",
G_CALLBACK (toggle_resize), paned->child1);
check_button = gtk_check_button_new_with_mnemonic ("_Shrink");
gtk_table_attach_defaults (GTK_TABLE (table), check_button,
0, 1, 2, 3);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_button),
TRUE);
gtk_signal_connect (GTK_OBJECT (check_button), "toggled",
GTK_SIGNAL_FUNC (toggle_shrink),
paned->child1);
g_signal_connect (check_button, "toggled",
G_CALLBACK (toggle_shrink), paned->child1);
label = gtk_label_new (label2);
gtk_table_attach_defaults (GTK_TABLE (table), label,
......@@ -99,18 +97,16 @@ create_pane_options (GtkPaned *paned,
1, 2, 1, 2);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_button),
TRUE);
gtk_signal_connect (GTK_OBJECT (check_button), "toggled",
GTK_SIGNAL_FUNC (toggle_resize),
paned->child2);
g_signal_connect (check_button, "toggled",
G_CALLBACK (toggle_resize), paned->child2);
check_button = gtk_check_button_new_with_mnemonic ("_Shrink");
gtk_table_attach_defaults (GTK_TABLE (table), check_button,
1, 2, 2, 3);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_button),
TRUE);
gtk_signal_connect (GTK_OBJECT (check_button), "toggled",
GTK_SIGNAL_FUNC (toggle_shrink),
paned->child2);
g_signal_connect (check_button, "toggled",
G_CALLBACK (toggle_shrink), paned->child2);
return frame;
}
......@@ -129,9 +125,8 @@ do_panes (void)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC(gtk_widget_destroyed),
&window);
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
gtk_window_set_title (GTK_WINDOW (window), "Panes");
gtk_container_set_border_width (GTK_CONTAINER (window), 0);
......
......@@ -219,8 +219,8 @@ do_pixbufs (void)
gtk_window_set_title (GTK_WINDOW (window), "Pixbufs");
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (gtk_widget_destroyed), &window);
gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (cleanup_callback), NULL);
g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window);
g_signal_connect (window, "destroy", G_CALLBACK (cleanup_callback), NULL);
error = NULL;
......@@ -237,10 +237,8 @@ do_pixbufs (void)
g_error_free (error);
gtk_signal_connect (GTK_OBJECT (dialog),
"response",
GTK_SIGNAL_FUNC (gtk_widget_destroy),
NULL);
g_signal_connect (dialog, "response",
G_CALLBACK (gtk_widget_destroy), NULL);
gtk_widget_show (dialog);
}
......@@ -252,8 +250,8 @@ do_pixbufs (void)
da = gtk_drawing_area_new ();
gtk_signal_connect (GTK_OBJECT (da), "expose_event",
GTK_SIGNAL_FUNC (expose_cb), NULL);
g_signal_connect (da, "expose_event",
G_CALLBACK (expose_cb), NULL);
gtk_container_add (GTK_CONTAINER (window), da);
......
......@@ -116,10 +116,10 @@ do_sizegroup (void)
NULL);
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
gtk_signal_connect (GTK_OBJECT (window), "response",
GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL);
gtk_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC (gtk_widget_destroyed), &window);
g_signal_connect (window, "response",
G_CALLBACK (gtk_widget_destroy), NULL);
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
vbox = gtk_vbox_new (FALSE, 5);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE, 0);
......@@ -160,8 +160,8 @@ do_sizegroup (void)
gtk_box_pack_start (GTK_BOX (vbox), check_button, FALSE, FALSE, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_button), TRUE);
gtk_signal_connect (GTK_OBJECT (check_button), "toggled",
GTK_SIGNAL_FUNC (toggle_grouping), size_group);
g_signal_connect (check_button, "toggled",
G_CALLBACK (toggle_grouping), size_group);
}
if (!GTK_WIDGET_VISIBLE (window))
......
......@@ -86,7 +86,6 @@ id_to_macro (const gchar *id)
{
GString *macro;
const gchar *cp;
gchar *p;
/* gtk-foo -> GTK_STOCK_FOO */
......@@ -405,7 +404,7 @@ do_stock_browser (void)
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Stock Icons and Items");
gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC (gtk_widget_destroyed), &window);
g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window);
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
hbox = gtk_hbox_new (FALSE, 8);
......
......@@ -366,9 +366,8 @@ do_textview (void)
gtk_window_set_default_size (GTK_WINDOW (window),
450, 450);
gtk_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC(gtk_widget_destroyed),
&window);
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
gtk_window_set_title (GTK_WINDOW (window), "TextView");
gtk_container_set_border_width (GTK_CONTAINER (window), 0);
......
......@@ -215,13 +215,13 @@ main (int argc, char **argv)
gtk_widget_set_size_request (window, back_width, back_height);
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
gtk_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC (destroy_cb), NULL);
g_signal_connect (window, "destroy",
G_CALLBACK (destroy_cb), NULL);
da = gtk_drawing_area_new ();
gtk_signal_connect (GTK_OBJECT (da), "expose_event",
GTK_SIGNAL_FUNC (expose_cb), NULL);
g_signal_connect (da, "expose_event",
G_CALLBACK (expose_cb), NULL);
gtk_container_add (GTK_CONTAINER (window), da);
......
......@@ -160,10 +160,8 @@ progressive_timeout (gpointer data)
"Failure reading image file 'alphatest.png': %s",
g_strerror (errno));
gtk_signal_connect (GTK_OBJECT (dialog),
"response",
GTK_SIGNAL_FUNC (gtk_widget_destroy),
NULL);
g_signal_connect (dialog, "response",
G_CALLBACK (gtk_widget_destroy), NULL);
fclose (lc->image_stream);
lc->image_stream = NULL;
......@@ -190,10 +188,8 @@ progressive_timeout (gpointer data)
g_error_free (error);
gtk_signal_connect (GTK_OBJECT (dialog),
"response",
GTK_SIGNAL_FUNC (gtk_widget_destroy),
NULL);
g_signal_connect (dialog, "response",
G_CALLBACK (gtk_widget_destroy), NULL);
fclose (lc->image_stream);
lc->image_stream = NULL;
......@@ -229,10 +225,8 @@ progressive_timeout (gpointer data)
g_error_free (error);
gtk_signal_connect (GTK_OBJECT (dialog),
"response",
GTK_SIGNAL_FUNC (gtk_widget_destroy),
NULL);
g_signal_connect (dialog, "response",
G_CALLBACK (gtk_widget_destroy), NULL);
gtk_widget_show (dialog);
......@@ -264,10 +258,8 @@ progressive_timeout (gpointer data)
lc->filename,
g_strerror (errno));
gtk_signal_connect (GTK_OBJECT (dialog),
"response",
GTK_SIGNAL_FUNC (gtk_widget_destroy),
NULL);
g_signal_connect (dialog, "response",
G_CALLBACK (gtk_widget_destroy), NULL);
gtk_widget_show (dialog);
......@@ -285,14 +277,10 @@ progressive_timeout (gpointer data)
lc->pixbuf_loader = gdk_pixbuf_loader_new ();
g_signal_connect (G_OBJECT (lc->pixbuf_loader),
"area_prepared",
G_CALLBACK (progressive_prepared_callback),
image);
g_signal_connect (G_OBJECT (lc->pixbuf_loader),
"area_updated",
G_CALLBACK (progressive_updated_callback),
image);
g_signal_connect (G_OBJECT (lc->pixbuf_loader), "area_prepared",
G_CALLBACK (progressive_prepared_callback), image);
g_signal_connect (G_OBJECT (lc->pixbuf_loader), "area_updated",
G_CALLBACK (progressive_updated_callback), image);
}
/* leave timeout installed */
......
#include <config.h>
#include <gtk/gtk.h>
int close_app(GtkWidget *widget, gpointer data)
int
close_app (GtkWidget *widget, gpointer data)
{
gtk_main_quit();
gtk_main_quit ();
return TRUE;
}
int expose_cb(GtkWidget *drawing_area, GdkEventExpose *evt, gpointer data)
int
expose_cb (GtkWidget *drawing_area, GdkEventExpose *evt, gpointer data)
{
GdkPixbuf *pixbuf;
pixbuf = (GdkPixbuf *) gtk_object_get_data(GTK_OBJECT(drawing_area),
"pixbuf");
if(gdk_pixbuf_get_has_alpha (pixbuf))
pixbuf = (GdkPixbuf *) g_object_get_data (G_OBJECT (drawing_area), "pixbuf");
if (gdk_pixbuf_get_has_alpha (pixbuf))
{
gdk_draw_rgb_32_image(drawing_area->window,
drawing_area->style->black_gc,
evt->area.x, evt->area.y,
evt->area.width,
evt->area.height,
GDK_RGB_DITHER_MAX,
gdk_pixbuf_get_pixels (pixbuf) +
(evt->area.y * gdk_pixbuf_get_rowstride (pixbuf)) +
(evt->area.x * gdk_pixbuf_get_n_channels (pixbuf)),
gdk_pixbuf_get_rowstride (pixbuf));
gdk_draw_rgb_32_image (drawing_area->window,
drawing_area->style->black_gc,
evt->area.x, evt->area.y,
evt->area.width,
evt->area.height,
GDK_RGB_DITHER_MAX,
gdk_pixbuf_get_pixels (pixbuf) +
(evt->area.y * gdk_pixbuf_get_rowstride (pixbuf)) +
(evt->area.x * gdk_pixbuf_get_n_channels (pixbuf)),
gdk_pixbuf_get_rowstride (pixbuf));
}
else
{
gdk_draw_rgb_image(drawing_area->window,
drawing_area->style->black_gc,
evt->area.x, evt->area.y,
evt->area.width,
evt->area.height,
GDK_RGB_DITHER_NORMAL,
gdk_pixbuf_get_pixels (pixbuf) +
(evt->area.y * gdk_pixbuf_get_rowstride (pixbuf)) +
(evt->area.x * gdk_pixbuf_get_n_channels (pixbuf)),
gdk_pixbuf_get_rowstride (pixbuf));
gdk_draw_rgb_image (drawing_area->window,
drawing_area->style->black_gc,
evt->area.x, evt->area.y,