Remove old child of scrolled window before adding a new one when switching

2007-04-26  Tor Lillqvist  <tml@novell.com>

	* gtk/gtkinputdialog.c (gtk_input_dialog_fill_axes)
	(gtk_input_dialog_fill_keys): Remove old child of scrolled window
	before adding a new one when switching what input device is being
	handled. (#399425)


svn path=/trunk/; revision=17656
This commit is contained in:
Tor Lillqvist 2007-04-26 06:23:36 +00:00 committed by Tor Lillqvist
parent 931647f00d
commit a63d6b564b
2 changed files with 15 additions and 0 deletions

View File

@ -1,3 +1,10 @@
2007-04-26 Tor Lillqvist <tml@novell.com>
* gtk/gtkinputdialog.c (gtk_input_dialog_fill_axes)
(gtk_input_dialog_fill_keys): Remove old child of scrolled window
before adding a new one when switching what input device is being
handled. (#399425)
2007-04-26 Matthias Clasen <mclasen@redhat.com>
* modules/printbackends/lpr/gtkprintbackendlpr.c

View File

@ -532,6 +532,7 @@ gtk_input_dialog_fill_axes(GtkInputDialog *inputd, GdkDevice *info)
GtkWidget *option_menu;
GtkWidget *label;
GtkWidget *viewport;
GtkWidget *old_child;
/* remove all the old items */
if (inputd->axis_list)
@ -544,6 +545,9 @@ gtk_input_dialog_fill_axes(GtkInputDialog *inputd, GdkDevice *info)
gtk_table_set_col_spacings (GTK_TABLE (inputd->axis_list), 12);
viewport = gtk_viewport_new (NULL, NULL);
old_child = gtk_bin_get_child (GTK_BIN (inputd->axis_listbox));
if (old_child != NULL)
gtk_widget_destroy (old_child);
gtk_container_add (GTK_CONTAINER (inputd->axis_listbox), viewport);
gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport), GTK_SHADOW_NONE);
gtk_widget_show (viewport);
@ -680,6 +684,7 @@ gtk_input_dialog_fill_keys(GtkInputDialog *inputd, GdkDevice *info)
GtkWidget *button;
GtkWidget *hbox;
GtkWidget *viewport;
GtkWidget *old_child;
char buffer[32];
@ -695,6 +700,9 @@ gtk_input_dialog_fill_keys(GtkInputDialog *inputd, GdkDevice *info)
gtk_table_set_col_spacings (GTK_TABLE (inputd->keys_list), 12);
viewport = gtk_viewport_new (NULL, NULL);
old_child = gtk_bin_get_child (GTK_BIN (inputd->keys_listbox));
if (old_child != NULL)
gtk_widget_destroy (old_child);
gtk_container_add (GTK_CONTAINER (inputd->keys_listbox), viewport);
gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport), GTK_SHADOW_NONE);
gtk_widget_show (viewport);