diff options
author | BST 2002 Tony Gale <gale@gtk.org> | 2002-08-24 11:53:26 +0000 |
---|---|---|
committer | Tony Gale <gale@src.gnome.org> | 2002-08-24 11:53:26 +0000 |
commit | 1bfcf9ba16ca0ff12ae08f1bdf0a891f4ad73457 (patch) | |
tree | 8a4daa7edd4a34ce5059389b80e5d39f0352d6a6 /examples | |
parent | c22b614565cd30079a0eaf7534f1a3f4f2819c6b (diff) | |
download | gtk+-1bfcf9ba16ca0ff12ae08f1bdf0a891f4ad73457.tar.gz |
update g_connect_signal usage
Sat Aug 24 12:46:37 BST 2002 Tony Gale <gale@gtk.org>
* docs/tutorial/gtk-tut.sgml, examples/*:
update g_connect_signal usage
* docs/faq/gtk-faq.html: spelling/grammar fixes
Diffstat (limited to 'examples')
-rw-r--r-- | examples/calendar/calendar.c | 24 | ||||
-rw-r--r-- | examples/entry/entry.c | 10 | ||||
-rw-r--r-- | examples/filesel/filesel.c | 7 | ||||
-rw-r--r-- | examples/fixed/fixed.c | 2 | ||||
-rw-r--r-- | examples/gtkdial/dial_test.c | 2 | ||||
-rw-r--r-- | examples/helloworld/helloworld.c | 2 | ||||
-rw-r--r-- | examples/helloworld2/helloworld2.c | 4 | ||||
-rw-r--r-- | examples/menu/menu.c | 4 | ||||
-rw-r--r-- | examples/notebook/notebook.c | 10 | ||||
-rw-r--r-- | examples/packbox/packbox.c | 2 | ||||
-rw-r--r-- | examples/progressbar/progressbar.c | 10 | ||||
-rw-r--r-- | examples/radiobuttons/radiobuttons.c | 2 | ||||
-rw-r--r-- | examples/rangewidgets/rangewidgets.c | 4 | ||||
-rw-r--r-- | examples/rulers/rulers.c | 4 |
14 files changed, 43 insertions, 44 deletions
diff --git a/examples/calendar/calendar.c b/examples/calendar/calendar.c index b608a56477..96eb8731bd 100644 --- a/examples/calendar/calendar.c +++ b/examples/calendar/calendar.c @@ -220,15 +220,15 @@ void calendar_select_font( GtkWidget *button, g_signal_connect (G_OBJECT (window), "destroy", G_CALLBACK (gtk_widget_destroyed), - &calendar->font_dialog); + (gpointer) &calendar->font_dialog); g_signal_connect (G_OBJECT (GTK_FONT_SELECTION_DIALOG (window)->ok_button), "clicked", G_CALLBACK (calendar_font_selection_ok), - calendar); + (gpointer) calendar); g_signal_connect_swapped (G_OBJECT (GTK_FONT_SELECTION_DIALOG (window)->cancel_button), "clicked", G_CALLBACK (gtk_widget_destroy), - calendar->font_dialog); + G_OBJECT (calendar->font_dialog)); } window=calendar->font_dialog; if (!GTK_WIDGET_VISIBLE (window)) @@ -310,25 +310,25 @@ void create_calendar() gtk_container_add( GTK_CONTAINER (frame), calendar); g_signal_connect (G_OBJECT (calendar), "month_changed", G_CALLBACK (calendar_month_changed), - &calendar_data); + (gpointer) &calendar_data); g_signal_connect (G_OBJECT (calendar), "day_selected", G_CALLBACK (calendar_day_selected), - &calendar_data); + (gpointer) &calendar_data); g_signal_connect (G_OBJECT (calendar), "day_selected_double_click", G_CALLBACK (calendar_day_selected_double_click), - &calendar_data); + (gpointer) &calendar_data); g_signal_connect (G_OBJECT (calendar), "prev_month", G_CALLBACK (calendar_prev_month), - &calendar_data); + (gpointer) &calendar_data); g_signal_connect (G_OBJECT (calendar), "next_month", G_CALLBACK (calendar_next_month), - &calendar_data); + (gpointer) &calendar_data); g_signal_connect (G_OBJECT (calendar), "prev_year", G_CALLBACK (calendar_prev_year), - &calendar_data); + (gpointer) &calendar_data); g_signal_connect (G_OBJECT (calendar), "next_year", G_CALLBACK (calendar_next_year), - &calendar_data); + (gpointer) &calendar_data); separator = gtk_vseparator_new (); @@ -350,7 +350,7 @@ void create_calendar() g_signal_connect (G_OBJECT (toggle), "toggled", G_CALLBACK (calendar_toggle_flag), - &calendar_data); + (gpointer) &calendar_data); gtk_box_pack_start (GTK_BOX (vbox3), toggle, TRUE, TRUE, 0); calendar_data.flag_checkboxes[i] = toggle; } @@ -359,7 +359,7 @@ void create_calendar() g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (calendar_select_font), - &calendar_data); + (gpointer) &calendar_data); gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); /* diff --git a/examples/entry/entry.c b/examples/entry/entry.c index 34022ec737..32d35cdb49 100644 --- a/examples/entry/entry.c +++ b/examples/entry/entry.c @@ -46,7 +46,7 @@ int main( int argc, G_CALLBACK (gtk_main_quit), NULL); g_signal_connect_swapped (G_OBJECT (window), "delete_event", G_CALLBACK (gtk_widget_destroy), - window); + G_OBJECT (window)); vbox = gtk_vbox_new (FALSE, 0); gtk_container_add (GTK_CONTAINER (window), vbox); @@ -56,7 +56,7 @@ int main( int argc, gtk_entry_set_max_length (GTK_ENTRY (entry), 50); g_signal_connect (G_OBJECT (entry), "activate", G_CALLBACK (enter_callback), - entry); + (gpointer) entry); gtk_entry_set_text (GTK_ENTRY (entry), "hello"); tmp_pos = GTK_ENTRY (entry)->text_length; gtk_editable_insert_text (GTK_EDITABLE (entry), " world", -1, &tmp_pos); @@ -72,21 +72,21 @@ int main( int argc, check = gtk_check_button_new_with_label ("Editable"); gtk_box_pack_start (GTK_BOX (hbox), check, TRUE, TRUE, 0); g_signal_connect (G_OBJECT (check), "toggled", - G_CALLBACK (entry_toggle_editable), entry); + G_CALLBACK (entry_toggle_editable), (gpointer) entry); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), TRUE); gtk_widget_show (check); check = gtk_check_button_new_with_label ("Visible"); gtk_box_pack_start (GTK_BOX (hbox), check, TRUE, TRUE, 0); g_signal_connect (G_OBJECT (check), "toggled", - G_CALLBACK (entry_toggle_visibility), entry); + G_CALLBACK (entry_toggle_visibility), (gpointer) entry); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), TRUE); gtk_widget_show (check); button = gtk_button_new_from_stock (GTK_STOCK_CLOSE); g_signal_connect_swapped (G_OBJECT (button), "clicked", G_CALLBACK (gtk_widget_destroy), - window); + G_OBJECT (window)); gtk_box_pack_start (GTK_BOX (vbox), button, TRUE, TRUE, 0); GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); gtk_widget_grab_default (button); diff --git a/examples/filesel/filesel.c b/examples/filesel/filesel.c index c711647674..8e26725ec5 100644 --- a/examples/filesel/filesel.c +++ b/examples/filesel/filesel.c @@ -22,13 +22,12 @@ int main( int argc, G_CALLBACK (gtk_main_quit), NULL); /* Connect the ok_button to file_ok_sel function */ g_signal_connect (G_OBJECT (GTK_FILE_SELECTION (filew)->ok_button), - "clicked", - G_CALLBACK (file_ok_sel), filew); + "clicked", G_CALLBACK (file_ok_sel), (gpointer) filew); /* Connect the cancel_button to destroy the widget */ g_signal_connect_swapped (G_OBJECT (GTK_FILE_SELECTION (filew)->cancel_button), - "clicked", - G_CALLBACK (gtk_widget_destroy), filew); + "clicked", G_CALLBACK (gtk_widget_destroy), + G_OBJECT (filew)); /* Lets set the filename, as if this were a save dialog, and we are giving a default filename */ diff --git a/examples/fixed/fixed.c b/examples/fixed/fixed.c index dba62e1358..3a58beeb53 100644 --- a/examples/fixed/fixed.c +++ b/examples/fixed/fixed.c @@ -53,7 +53,7 @@ int main( int argc, * function move_button() passing it the Fixed Container as its * argument. */ g_signal_connect (G_OBJECT (button), "clicked", - G_CALLBACK (move_button), fixed); + G_CALLBACK (move_button), (gpointer) fixed); /* This packs the button into the fixed containers window. */ gtk_fixed_put (GTK_FIXED (fixed), button, i*50, i*50); diff --git a/examples/gtkdial/dial_test.c b/examples/gtkdial/dial_test.c index 3d02c79565..3944c8b397 100644 --- a/examples/gtkdial/dial_test.c +++ b/examples/gtkdial/dial_test.c @@ -57,7 +57,7 @@ int main( int argc, gtk_widget_show (label); g_signal_connect (G_OBJECT (adjustment), "value_changed", - G_CALLBACK (value_changed), label); + G_CALLBACK (value_changed), (gpointer) label); gtk_widget_show (window); diff --git a/examples/helloworld/helloworld.c b/examples/helloworld/helloworld.c index 606b55cc3b..ad66be6e9b 100644 --- a/examples/helloworld/helloworld.c +++ b/examples/helloworld/helloworld.c @@ -79,7 +79,7 @@ int main( int argc, * signal could come from here, or the window manager. */ g_signal_connect_swapped (G_OBJECT (button), "clicked", G_CALLBACK (gtk_widget_destroy), - window); + G_OBJECT (window)); /* This packs the button into the window (a gtk container). */ gtk_container_add (GTK_CONTAINER (window), button); diff --git a/examples/helloworld2/helloworld2.c b/examples/helloworld2/helloworld2.c index 37c17d0a8e..5f2b27ae27 100644 --- a/examples/helloworld2/helloworld2.c +++ b/examples/helloworld2/helloworld2.c @@ -59,7 +59,7 @@ int main( int argc, /* Now when the button is clicked, we call the "callback" function * with a pointer to "button 1" as its argument */ g_signal_connect (G_OBJECT (button), "clicked", - G_CALLBACK (callback), "button 1"); + G_CALLBACK (callback), (gpointer) "button 1"); /* Instead of gtk_container_add, we pack this button into the invisible * box, which has been packed into the window. */ @@ -75,7 +75,7 @@ int main( int argc, /* Call the same callback function with a different argument, * passing a pointer to "button 2" instead. */ g_signal_connect (G_OBJECT (button), "clicked", - G_CALLBACK (callback), "button 2"); + G_CALLBACK (callback), (gpointer) "button 2"); gtk_box_pack_start(GTK_BOX (box1), button, TRUE, TRUE, 0); diff --git a/examples/menu/menu.c b/examples/menu/menu.c index 4747ef889f..94271df94d 100644 --- a/examples/menu/menu.c +++ b/examples/menu/menu.c @@ -54,7 +54,7 @@ int main( int argc, /* Do something interesting when the menuitem is selected */ g_signal_connect_swapped (G_OBJECT (menu_items), "activate", G_CALLBACK (menuitem_response), - g_strdup (buf)); + (gpointer) g_strdup (buf)); /* Show the widget */ gtk_widget_show (menu_items); @@ -85,7 +85,7 @@ int main( int argc, button = gtk_button_new_with_label ("press me"); g_signal_connect_swapped (G_OBJECT (button), "event", G_CALLBACK (button_press), - menu); + G_OBJECT (menu)); gtk_box_pack_end (GTK_BOX (vbox), button, TRUE, TRUE, 2); gtk_widget_show (button); diff --git a/examples/notebook/notebook.c b/examples/notebook/notebook.c index 7435d40f29..39deba1f75 100644 --- a/examples/notebook/notebook.c +++ b/examples/notebook/notebook.c @@ -134,35 +134,35 @@ int main( int argc, button = gtk_button_new_with_label ("next page"); g_signal_connect_swapped (G_OBJECT (button), "clicked", G_CALLBACK (gtk_notebook_next_page), - notebook); + G_OBJECT (notebook)); gtk_table_attach_defaults (GTK_TABLE (table), button, 1, 2, 1, 2); gtk_widget_show (button); button = gtk_button_new_with_label ("prev page"); g_signal_connect_swapped (G_OBJECT (button), "clicked", G_CALLBACK (gtk_notebook_prev_page), - notebook); + G_OBJECT (notebook)); gtk_table_attach_defaults (GTK_TABLE (table), button, 2, 3, 1, 2); gtk_widget_show (button); button = gtk_button_new_with_label ("tab position"); g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (rotate_book), - notebook); + (gpointer) notebook); gtk_table_attach_defaults (GTK_TABLE (table), button, 3, 4, 1, 2); gtk_widget_show (button); button = gtk_button_new_with_label ("tabs/border on/off"); g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (tabsborder_book), - notebook); + (gpointer) notebook); gtk_table_attach_defaults (GTK_TABLE (table), button, 4, 5, 1, 2); gtk_widget_show (button); button = gtk_button_new_with_label ("remove page"); g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (remove_book), - notebook); + (gpointer) notebook); gtk_table_attach_defaults (GTK_TABLE (table), button, 5, 6, 1, 2); gtk_widget_show (button); diff --git a/examples/packbox/packbox.c b/examples/packbox/packbox.c index fe411625d2..ae5d9e3be6 100644 --- a/examples/packbox/packbox.c +++ b/examples/packbox/packbox.c @@ -261,7 +261,7 @@ int main( int argc, /* Setup the signal to terminate the program when the button is clicked */ g_signal_connect_swapped (G_OBJECT (button), "clicked", G_CALLBACK (gtk_main_quit), - window); + G_OBJECT (window)); /* Pack the button into the quitbox. * The last 3 arguments to gtk_box_pack_start are: * expand, fill, padding. */ diff --git a/examples/progressbar/progressbar.c b/examples/progressbar/progressbar.c index 73d0975e9e..7420d24d77 100644 --- a/examples/progressbar/progressbar.c +++ b/examples/progressbar/progressbar.c @@ -112,7 +112,7 @@ int main( int argc, g_signal_connect (G_OBJECT (pdata->window), "destroy", G_CALLBACK (destroy_progress), - pdata); + (gpointer) pdata); gtk_window_set_title (GTK_WINDOW (pdata->window), "GtkProgressBar"); gtk_container_set_border_width (GTK_CONTAINER (pdata->window), 0); @@ -151,7 +151,7 @@ int main( int argc, 5, 5); g_signal_connect (G_OBJECT (check), "clicked", G_CALLBACK (toggle_show_text), - pdata); + (gpointer) pdata); gtk_widget_show (check); /* Add a check button to toggle activity mode */ @@ -161,7 +161,7 @@ int main( int argc, 5, 5); g_signal_connect (G_OBJECT (check), "clicked", G_CALLBACK (toggle_activity_mode), - pdata); + (gpointer) pdata); gtk_widget_show (check); /* Add a check button to toggle orientation */ @@ -171,14 +171,14 @@ int main( int argc, 5, 5); g_signal_connect (G_OBJECT (check), "clicked", G_CALLBACK (toggle_orientation), - pdata); + (gpointer) pdata); gtk_widget_show (check); /* Add a button to exit the program */ button = gtk_button_new_with_label ("close"); g_signal_connect_swapped (G_OBJECT (button), "clicked", G_CALLBACK (gtk_widget_destroy), - pdata->window); + G_OBJECT (pdata->window)); gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); /* This makes it so the button is the default. */ diff --git a/examples/radiobuttons/radiobuttons.c b/examples/radiobuttons/radiobuttons.c index 6d1c27096b..b3fe809a66 100644 --- a/examples/radiobuttons/radiobuttons.c +++ b/examples/radiobuttons/radiobuttons.c @@ -67,7 +67,7 @@ int main( int argc, button = gtk_button_new_with_label ("close"); g_signal_connect_swapped (G_OBJECT (button), "clicked", G_CALLBACK (close_application), - window); + G_OBJECT (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); diff --git a/examples/rangewidgets/rangewidgets.c b/examples/rangewidgets/rangewidgets.c index eeb311d6eb..457dd6a4a3 100644 --- a/examples/rangewidgets/rangewidgets.c +++ b/examples/rangewidgets/rangewidgets.c @@ -59,7 +59,7 @@ GtkWidget *make_menu_item (gchar *name, item = gtk_menu_item_new_with_label (name); g_signal_connect (G_OBJECT (item), "activate", - callback, data); + callback, (gpointer) data); gtk_widget_show (item); return item; @@ -248,7 +248,7 @@ void create_range_controls( void ) adj2 = gtk_adjustment_new (1.0, 1.0, 101.0, 1.0, 1.0, 0.0); g_signal_connect (G_OBJECT (adj2), "value_changed", - G_CALLBACK (cb_page_size), adj1); + G_CALLBACK (cb_page_size), (gpointer) adj1); scale = gtk_hscale_new (GTK_ADJUSTMENT (adj2)); gtk_scale_set_digits (GTK_SCALE (scale), 0); gtk_box_pack_start (GTK_BOX (box2), scale, TRUE, TRUE, 0); diff --git a/examples/rulers/rulers.c b/examples/rulers/rulers.c index 0ad6c32e31..720f9dd29f 100644 --- a/examples/rulers/rulers.c +++ b/examples/rulers/rulers.c @@ -47,7 +47,7 @@ int main( int argc, gtk_ruler_set_range (GTK_RULER (hrule), 7, 13, 0, 20); g_signal_connect_swapped (G_OBJECT (area), "motion_notify_event", G_CALLBACK (EVENT_METHOD (hrule, motion_notify_event)), - hrule); + G_OBJECT (hrule)); gtk_table_attach (GTK_TABLE (table), hrule, 1, 2, 0, 1, GTK_EXPAND|GTK_SHRINK|GTK_FILL, GTK_FILL, 0, 0); @@ -59,7 +59,7 @@ int main( int argc, gtk_ruler_set_range (GTK_RULER (vrule), 0, YSIZE, 10, YSIZE ); g_signal_connect_swapped (G_OBJECT (area), "motion_notify_event", G_CALLBACK (EVENT_METHOD (vrule, motion_notify_event)), - vrule); + G_OBJECT (vrule)); gtk_table_attach (GTK_TABLE (table), vrule, 0, 1, 1, 2, GTK_FILL, GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0); |