fixed a refresh bug with unrealization of no_window widgets.

(dialog button in tesgtk)
-timj
This commit is contained in:
Tim Janik 1998-02-02 05:35:59 +00:00
parent 58df302b15
commit 57bae55574
4 changed files with 21 additions and 14 deletions

View File

@ -56,6 +56,9 @@
/* Define if you have the memmove function. */
#undef HAVE_MEMMOVE
/* Define if you have the strcasecmp function. */
#undef HAVE_STRCASECMP
/* Define if you have the strerror function. */
#undef HAVE_STRERROR
@ -65,9 +68,6 @@
/* Define if you have the vsnprintf function. */
#undef HAVE_VSNPRINTF
/* Define if you have the strcasecmp function. */
#undef HAVE_STRCASECMP
/* Define if you have the <float.h> header file. */
#undef HAVE_FLOAT_H

View File

@ -3303,6 +3303,9 @@ gtk_widget_real_unrealize (GtkWidget *widget)
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_WIDGET (widget));
if (GTK_WIDGET_NO_WINDOW (widget) && GTK_WIDGET_MAPPED (widget))
gtk_widget_real_unmap (widget);
GTK_WIDGET_UNSET_FLAGS (widget, GTK_REALIZED | GTK_MAPPED);
/* printf ("unrealizing %s\n", gtk_type_name (GTK_OBJECT(widget)->klass->type));
@ -3320,7 +3323,9 @@ gtk_widget_real_unrealize (GtkWidget *widget)
gdk_window_destroy (widget->window);
}
else
gdk_window_unref (widget->window);
{
gdk_window_unref (widget->window);
}
widget->window = NULL;
}

View File

@ -2018,16 +2018,17 @@ label_toggle (GtkWidget *widget,
if (!(*label))
{
*label = gtk_label_new ("Dialog Test");
gtk_signal_connect (GTK_OBJECT (*label),
"destroy",
GTK_SIGNAL_FUNC (gtk_widget_destroyed),
label);
gtk_misc_set_padding (GTK_MISC (*label), 10, 10);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog_window)->vbox),
*label, TRUE, TRUE, 0);
gtk_widget_show (*label);
}
else
{
gtk_widget_destroy (*label);
*label = NULL;
}
gtk_widget_destroy (*label);
}
void
@ -2059,7 +2060,7 @@ create_dialog ()
button = gtk_button_new_with_label ("Toggle");
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC(label_toggle),
GTK_SIGNAL_FUNC (label_toggle),
&label);
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog_window)->action_area),

View File

@ -2018,16 +2018,17 @@ label_toggle (GtkWidget *widget,
if (!(*label))
{
*label = gtk_label_new ("Dialog Test");
gtk_signal_connect (GTK_OBJECT (*label),
"destroy",
GTK_SIGNAL_FUNC (gtk_widget_destroyed),
label);
gtk_misc_set_padding (GTK_MISC (*label), 10, 10);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog_window)->vbox),
*label, TRUE, TRUE, 0);
gtk_widget_show (*label);
}
else
{
gtk_widget_destroy (*label);
*label = NULL;
}
gtk_widget_destroy (*label);
}
void
@ -2059,7 +2060,7 @@ create_dialog ()
button = gtk_button_new_with_label ("Toggle");
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC(label_toggle),
GTK_SIGNAL_FUNC (label_toggle),
&label);
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog_window)->action_area),