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

[gtk-list] Re: Notebook problems [patch] (fwd)



Hey


I didn't try this patch to gtk yet (not behind my computer right now), but
it *should* help us with some weird things like text that doesn't show up.

bye,


Remco

.-----------------------------------------------------------------------------.
| Remco van de Meent                   |                   remco@mnemonic.org |
| Mnemonic Browser Project             |              http://www.mnemonic.org |
`-----------------------------------------------------------------------------'

---------- Forwarded message ----------
Date: 20 Sep 1997 13:17:32 -0400
From: Owen Taylor <owt1@cornell.edu>
Reply-To: gtk-list@redhat.com
To: gtk-list@redhat.com
Subject: [gtk-list] Re: Notebook problems [patch]
Resent-Date: 20 Sep 1997 17:15:44 -0000
Resent-From: gtk-list@redhat.com
Resent-cc: recipient list not shown:;


Remco van de Meent <oloon-gtk-list@cal052204.student.utwente.nl> writes:

> Problem: 
>   when pressing a button, a notebook should be added. This happens indeed.
>   But, the label IN the notebook isn't displayed...
> 
> 
> We ripped some of the testgtk.c code to test some things, and it looks like
> a bug in gtk.

Yep... the container is responsible for making sure the new child is
realized and mapped if necessary. So the following code needs to be added:

*** gtk+970916/gtk/gtknotebook.c.ots	Sat Sep 20 12:56:46 1997
--- gtk+970916/gtk/gtknotebook.c	Sat Sep 20 13:14:05 1997
***************
*** 196,201 ****
--- 196,220 ----
    gtk_widget_set_parent (child, GTK_WIDGET (notebook));
    gtk_widget_set_parent (tab_label, GTK_WIDGET (notebook));
  
+   if (GTK_WIDGET_VISIBLE (notebook))
+     {
+       if (GTK_WIDGET_REALIZED (notebook) &&
+ 	  !GTK_WIDGET_REALIZED (child))
+ 	gtk_widget_realize (child);
+       
+       if (GTK_WIDGET_MAPPED (notebook) &&
+ 	  !GTK_WIDGET_MAPPED (child) && notebook->cur_page == page)
+ 	gtk_widget_map (child);
+ 
+       if (GTK_WIDGET_REALIZED (notebook) &&
+ 	  !GTK_WIDGET_REALIZED (tab_label))
+ 	gtk_widget_realize (tab_label);
+       
+       if (GTK_WIDGET_MAPPED (notebook) &&
+ 	  !GTK_WIDGET_MAPPED (tab_label))
+ 	gtk_widget_map (tab_label);
+     }
+ 
    if (GTK_WIDGET_VISIBLE (child) && GTK_WIDGET_VISIBLE (notebook))
      gtk_widget_queue_resize (child);
  }

--
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null