Unlinking a notebook page, was: gtk_widget_unparent



On Fri, 22 Mar 2002 16:21:28 +0100, Dr. Peter Rottengatter <peter rottengatter de> wrote:

You should probably use gtk_container_remove to remove a widget from a
container widget, unless the contain widget has a specific removal API
call. For example the notebook widget has its own API for removing a
page. Things like the packing boxes do not.

I'll check gtk_container_remove, thinks for the hint, but from the 
wording of the function name I suspect it does pretty much the same as
gtk_notebook_remove_page, i.e. removing and *discarding* the sub-tree, 
leaving the notebook with one page less behind. I want it exactly the
other way round.

Ok, found out there is no such thing as gtk_container_remove. According to
docs, add/removal functions are all implemented by the inheriting classes.

Now I've mentioned gtk_notebook_remove_page above, which I looked at a bit 
closer. I found that saying it discards the removed page is not quite right.
In fact I can obtain a pointer to the page-top-level widget (the one that's
been inserted into the notebook using gtk_notebook_append_page), then remove
that page, and I can still play with the page sub-tree. I tried using this
for my problem, i.e. notebook_append'ing it into another notebook. This works
perfectly, even with lots of further gtk object creation and destruction
going on in the program after that. Hmm, should say "almost perfectly", though,
as there is still one thing unresolved: gtk_widget_destruction of the notebook
from which the page is removed immediately creates problems with handling the
removed page. So this means, gtk_notebook_remove_page doesn't even sever all
the links to and from the page.

Seems I really have to dig into the GTK source code to find out which pieces
of the docs are right, and what gtk_notebook_remove_page really does.


Cheers  Peter

PS.: Why is it that it takes several days until postings to the mailing list 
      actually appear in the list ? What I cited above came from my outbox,
      rather than the echo from the mailing list, even though the original 
      posting was sent some 20 hours ago.
-- 
---------------------------------------------------------------------
      Dr. Peter Rottengatter       peter rottengatter de
                                   http://www.rottengatter.de
---------------------------------------------------------------------



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