diff --git a/docs/reference/ChangeLog b/docs/reference/ChangeLog index b18fd51cc0..e57060321c 100644 --- a/docs/reference/ChangeLog +++ b/docs/reference/ChangeLog @@ -1,5 +1,14 @@ 2004-04-23 Matthias Clasen + * gtk/tmpl/gtkdialog.sgml: + * gtk/tmpl/gtkeditable.sgml: + * gtk/tmpl/gtkfilesel.sgml: + * gtk/tmpl/gtkmain.sgml: + * gtk/tmpl/gtkmenu.sgml: + * gtk/tmpl/gtkmessagedialog.sgml: + * gtk/tmpl/gtktogglebutton.sgml: Remove excessive + casts from examples. (#139387, Olexiy Avramchenko) + * gtk/migrating-GtkAction.sgml: Fix an example. (#138966, Tim-Philipp Müller) diff --git a/docs/reference/gtk/tmpl/gtkdialog.sgml b/docs/reference/gtk/tmpl/gtkdialog.sgml index b6e02e982b..c9d2bf1579 100644 --- a/docs/reference/gtk/tmpl/gtkdialog.sgml +++ b/docs/reference/gtk/tmpl/gtkdialog.sgml @@ -89,10 +89,10 @@ void quick_message (gchar *message) { /* Ensure that the dialog box is destroyed when the user responds. */ - g_signal_connect_swapped (GTK_OBJECT (dialog), + g_signal_connect_swapped (dialog, "response", G_CALLBACK (gtk_widget_destroy), - GTK_OBJECT (dialog)); + dialog); /* Add the label, and show everything we've added to the dialog. */ diff --git a/docs/reference/gtk/tmpl/gtkeditable.sgml b/docs/reference/gtk/tmpl/gtkeditable.sgml index c999fe84cd..eba4ad2f2f 100644 --- a/docs/reference/gtk/tmpl/gtkeditable.sgml +++ b/docs/reference/gtk/tmpl/gtkeditable.sgml @@ -36,13 +36,13 @@ insert_text_handler (GtkEditable *editable, for (i = 0; i < length; i++) result[i] = islower (text[i]) ? toupper (text[i]) : text[i]; - g_signal_handlers_block_by_func (GTK_OBJECT (editable), - insert_text_handler, data); + g_signal_handlers_block_by_func (editable, + (gpointer) insert_text_handler, data); gtk_editable_insert_text (editable, result, length, position); - g_signal_handlers_unblock_by_func (GTK_OBJECT (editable), - insert_text_handler, data); + g_signal_handlers_unblock_by_func (editable, + (gpointer) insert_text_handler, data); - g_signal_stop_emission_by_name (GTK_OBJECT (editable), "insert_text"); + g_signal_stop_emission_by_name (editable, "insert_text"); g_free (result); } diff --git a/docs/reference/gtk/tmpl/gtkfilesel.sgml b/docs/reference/gtk/tmpl/gtkfilesel.sgml index d4f25ad4db..f00da8b8b0 100644 --- a/docs/reference/gtk/tmpl/gtkfilesel.sgml +++ b/docs/reference/gtk/tmpl/gtkfilesel.sgml @@ -35,7 +35,7 @@ Simple file operations; create directory, delete file, and rename file, are avai /* The file selection widget and the string to store the chosen filename */ void store_filename (GtkWidget *widget, gpointer user_data) { - GtkWidget *file_selector = (GtkWidget *)user_data; + GtkWidget *file_selector = GTK_WIDGET (user_data); const gchar *selected_filename; selected_filename = gtk_file_selection_get_filename (GTK_FILE_SELECTION (file_selector)); @@ -50,22 +50,22 @@ void create_file_selection (void) { file_selector = gtk_file_selection_new ("Please select a file for editing."); - g_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (file_selector)->ok_button), + g_signal_connect (GTK_FILE_SELECTION (file_selector)->ok_button, "clicked", G_CALLBACK (store_filename), - (gpointer) file_selector); + file_selector); /* Ensure that the dialog box is destroyed when the user clicks a button. */ - g_signal_connect_swapped (GTK_OBJECT (GTK_FILE_SELECTION (file_selector)->ok_button), + g_signal_connect_swapped (GTK_FILE_SELECTION (file_selector)->ok_button, "clicked", G_CALLBACK (gtk_widget_destroy), - (gpointer) file_selector); + file_selector); - g_signal_connect_swapped (GTK_OBJECT (GTK_FILE_SELECTION (file_selector)->cancel_button), + g_signal_connect_swapped (GTK_FILE_SELECTION (file_selector)->cancel_button, "clicked", G_CALLBACK (gtk_widget_destroy), - (gpointer) file_selector); + file_selector); /* Display that dialog */ diff --git a/docs/reference/gtk/tmpl/gtkmain.sgml b/docs/reference/gtk/tmpl/gtkmain.sgml index b55a153236..4ead17f989 100644 --- a/docs/reference/gtk/tmpl/gtkmain.sgml +++ b/docs/reference/gtk/tmpl/gtkmain.sgml @@ -310,14 +310,14 @@ main (int argc, char **argv) gtk_init( &argc, &argv ); win = gtk_window_new (GTK_WINDOW_TOPLEVEL); - g_signal_connect (GTK_OBJECT(win), "delete-event", + g_signal_connect (win, "delete-event", G_CALLBACK (gtk_true), NULL); - g_signal_connect (GTK_OBJECT(win), "destroy", + g_signal_connect (win, "destroy", G_CALLBACK (gtk_main_quit), NULL); but = gtk_button_new_with_label ("Close yourself. I mean it!"); - g_signal_connect_swapped (GTK_OBJECT (but), "clicked", - G_CALLBACK (gtk_object_destroy), (gpointer) win); + g_signal_connect_swapped (but, "clicked", + G_CALLBACK (gtk_object_destroy), win); gtk_container_add (GTK_CONTAINER (win), but); gtk_widget_show_all (win); diff --git a/docs/reference/gtk/tmpl/gtkmenu.sgml b/docs/reference/gtk/tmpl/gtkmenu.sgml index 6444be2cc2..553ebd5e5c 100644 --- a/docs/reference/gtk/tmpl/gtkmenu.sgml +++ b/docs/reference/gtk/tmpl/gtkmenu.sgml @@ -32,8 +32,8 @@ can pop up a menu when the 3rd mouse button is pressed. Connecting the popup signal handler. /* connect our handler which will popup the menu */ - g_signal_connect_swapped (GTK_OBJECT (window), "button_press_event", - G_CALLBACK (my_popup_handler), GTK_OBJECT (menu)); + g_signal_connect_swapped (window, "button_press_event", + G_CALLBACK (my_popup_handler), menu); diff --git a/docs/reference/gtk/tmpl/gtkmessagedialog.sgml b/docs/reference/gtk/tmpl/gtkmessagedialog.sgml index 8c4a6841da..7ba8f801a1 100644 --- a/docs/reference/gtk/tmpl/gtkmessagedialog.sgml +++ b/docs/reference/gtk/tmpl/gtkmessagedialog.sgml @@ -46,9 +46,9 @@ You might do a non-modal #GtkMessageDialog as follows: filename, g_strerror (errno)); /* Destroy the dialog when the user responds to it (e.g. clicks a button) */ - g_signal_connect_swapped (GTK_OBJECT (dialog), "response", + g_signal_connect_swapped (dialog, "response", G_CALLBACK (gtk_widget_destroy), - GTK_OBJECT (dialog)); + dialog); diff --git a/docs/reference/gtk/tmpl/gtktogglebutton.sgml b/docs/reference/gtk/tmpl/gtktogglebutton.sgml index 1809aa6429..c1ed0a54b5 100644 --- a/docs/reference/gtk/tmpl/gtktogglebutton.sgml +++ b/docs/reference/gtk/tmpl/gtktogglebutton.sgml @@ -37,14 +37,14 @@ void make_toggles (void) { /* Makes this toggle button invisible */ gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (toggle1), TRUE); - g_signal_connect (GTK_OBJECT (toggle1), "toggled", + g_signal_connect (toggle1, "toggled", G_CALLBACK (output_state), NULL); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area), toggle1, FALSE, FALSE, 2); toggle2 = gtk_toggle_button_new_with_label ("Hi, i'm another toggle button."); gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (toggle2), FALSE); - g_signal_connect (GTK_OBJECT (toggle2), "toggled", + g_signal_connect (toggle2, "toggled", G_CALLBACK (output_state), NULL); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->action_area), toggle2, FALSE, FALSE, 2);