diff options
author | Sven Neumann <sven@gimp.org> | 2008-08-11 18:36:07 +0000 |
---|---|---|
committer | Sven Neumann <neo@src.gnome.org> | 2008-08-11 18:36:07 +0000 |
commit | 82f6ccd79cc9c6c1d032a620649c1a0b500943eb (patch) | |
tree | a7fe470d84196b53139ee2d9d8f4bef6c352edcc /examples/selection/setselection.c | |
parent | e3e126ae9eb9f860f2b99157d18cb3d6428add78 (diff) | |
download | gtk+-82f6ccd79cc9c6c1d032a620649c1a0b500943eb.tar.gz |
updated the (quite outdated) examples to use canonical signal names as
2008-08-11 Sven Neumann <sven@gimp.org>
* examples/*: updated the (quite outdated) examples to use
canonical signal names as well. Removed some unneeded casts and
trailing whitespace while I was on it...
svn path=/trunk/; revision=21071
Diffstat (limited to 'examples/selection/setselection.c')
-rw-r--r-- | examples/selection/setselection.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/examples/selection/setselection.c b/examples/selection/setselection.c index 8ecf96c42a..1e22c4eea1 100644 --- a/examples/selection/setselection.c +++ b/examples/selection/setselection.c @@ -47,7 +47,7 @@ static gboolean selection_clear( GtkWidget *widget, } /* Supplies the current time as the selection. */ -static void selection_handle( GtkWidget *widget, +static void selection_handle( GtkWidget *widget, GtkSelectionData *selection_data, guint info, guint time_stamp, @@ -57,7 +57,7 @@ static void selection_handle( GtkWidget *widget, time_t current_time; current_time = time (NULL); - timestr = asctime (localtime (¤t_time)); + timestr = asctime (localtime (¤t_time)); /* When we return a single string, it should not be null terminated. That will be done for us */ @@ -71,7 +71,7 @@ int main( int argc, GtkWidget *window; static int have_selection = FALSE; - + gtk_init (&argc, &argv); /* Create the toplevel window */ @@ -80,7 +80,7 @@ int main( int argc, gtk_window_set_title (GTK_WINDOW (window), "Event Box"); gtk_container_set_border_width (GTK_CONTAINER (window), 10); - g_signal_connect (G_OBJECT (window), "destroy", + g_signal_connect (window, "destroy", G_CALLBACK (exit), NULL); /* Create a toggle button to act as the selection */ @@ -90,22 +90,22 @@ int main( int argc, gtk_container_add (GTK_CONTAINER (window), selection_button); gtk_widget_show (selection_button); - g_signal_connect (G_OBJECT (selection_button), "toggled", - G_CALLBACK (selection_toggled), (gpointer) &have_selection); - g_signal_connect (G_OBJECT (selection_widget), "selection_clear_event", - G_CALLBACK (selection_clear), (gpointer) &have_selection); + g_signal_connect (selection_button, "toggled", + G_CALLBACK (selection_toggled), &have_selection); + g_signal_connect (selection_widget, "selection-clear-event", + G_CALLBACK (selection_clear), &have_selection); gtk_selection_add_target (selection_widget, GDK_SELECTION_PRIMARY, GDK_SELECTION_TYPE_STRING, 1); - g_signal_connect (G_OBJECT (selection_widget), "selection_get", - G_CALLBACK (selection_handle), (gpointer) &have_selection); + g_signal_connect (selection_widget, "selection-get", + G_CALLBACK (selection_handle), &have_selection); gtk_widget_show (selection_button); gtk_widget_show (window); - + gtk_main (); - + return 0; } |