BUG: gtk_widget_hide_all for frames



Hi,

I think I found a bug in the current devel-release of GTK+ (1.1.5, and
snapshot 98/12/03): If a widget (surrounded by a frame) is put within
a scrolled window and I call the function gtk_widget_hide_all for this 
frame, then the widget is hidden but not the frame (actually it is
hidden but the image is still on screen, I must switch workspaces to
refresh the screen).
Attached is the code to reproduce the bug. I also made two GIF images
that visualize this behavior:

http://www-info2.informatik.uni-wuerzburg.de/staff/ulli/gtkstep/demo1.gif
http://www-info2.informatik.uni-wuerzburg.de/staff/ulli/gtkstep/demo2.gif

Regards,

Ullrich

P.S: compiled with 
gcc -Wall -g -O3 demo.c -o demo `gtk-config --cflags` `gtk-config --libs`
on a libc based Intel-Linux system (XFree 3.3.2).
#include <gtk/gtk.h>

GtkWidget *entrybox = NULL;

static void
hide_me (GtkWidget *widget, gpointer ptr)
{
   gtk_widget_hide_all (entrybox);
}

int
main (int argc, char **argv)
{
   GtkWidget *main_window;
   GtkWidget *dialog;
   GtkWidget *main_hbox;
   GtkWidget *main_vbox;
   GtkWidget *frame;
   GtkWidget *button;
   GtkWidget *hbox;
   GtkWidget *entry;

   gtk_init (&argc, &argv);

   main_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
   gtk_widget_set_usize (main_window, 300, 300);
   gtk_container_border_width (GTK_CONTAINER (main_window), 0);
   gtk_widget_show_all (main_window);

   dialog = gtk_scrolled_window_new (NULL, NULL);
   
   main_hbox = gtk_hbox_new (FALSE, 5);
   gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (dialog),
					  main_hbox);

   main_vbox = gtk_vbox_new (FALSE, 5);
   gtk_box_pack_start (GTK_BOX (main_hbox), main_vbox, FALSE, TRUE, 5);
      
   button = gtk_button_new_with_label ("hide me ...");
   gtk_signal_connect (GTK_OBJECT (button), "pressed",
		       GTK_SIGNAL_FUNC (hide_me),  NULL);
   gtk_box_pack_start (GTK_BOX (main_vbox), button, FALSE, TRUE, 5);
   
   entrybox = frame = gtk_frame_new ("Entrybox");
   gtk_box_pack_start (GTK_BOX (main_vbox), frame, FALSE, TRUE, 5);

   hbox = gtk_hbox_new (FALSE, 5);
   gtk_container_add (GTK_CONTAINER (frame), hbox);
      
   entry = gtk_entry_new ();
   gtk_box_pack_start (GTK_BOX (hbox), entry, FALSE, TRUE, 5);

   gtk_container_add (GTK_CONTAINER (main_window), dialog);
   gtk_widget_show_all (dialog);

   gtk_widget_show_all (main_window);

   gtk_main ();

   return 0;
}
-- 
Ullrich Hafner <hafner@bigfoot.de>, http://www.bigfoot.com/~uhafner


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]