Remove excessive casts from examples. (#139387, Olexiy Avramchenko)

2004-04-23  Matthias Clasen  <mclasen@redhat.com>

	* 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)
This commit is contained in:
Matthias Clasen 2004-04-23 19:48:08 +00:00 committed by Matthias Clasen
parent 93853344ce
commit 34265f4f09
8 changed files with 33 additions and 24 deletions

View File

@ -1,5 +1,14 @@
2004-04-23 Matthias Clasen <mclasen@redhat.com>
* 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)

View File

@ -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. */

View File

@ -36,13 +36,13 @@ insert_text_handler (GtkEditable *editable,
for (i = 0; i &lt; 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);
}

View File

@ -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 */

View File

@ -310,14 +310,14 @@ main (int argc, char **argv)
gtk_init( &amp;argc, &amp;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);

View File

@ -32,8 +32,8 @@ can pop up a menu when the 3rd mouse button is pressed.
<title>Connecting the popup signal handler.</title>
<programlisting>
/* 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);
</programlisting>
</example>

View File

@ -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);
</programlisting>
</example>
</para>

View File

@ -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);