Re: [gtk-list] Re: Dynamic modification of widgets





> > I have a window with a horizontally split pane in it right now.  I want
> > to, based on user input, modify it so it becomes a vertical split,
> > verticle + horizontal, etc.
> > 
> > How do I go about safely deleting the pane and everything in it?  Could I
> > just call gtk_widget_delete on the box holding it, or would that not quite
> > do the job?
>                        ^^^^^^
> s/delete/destroy/
> 
> That will work fine. (If, however, you remove some of the widgets it
> holds with gtk_container_remove() before destroying it, remember to
> gtk_widget_ref() them before removing them and gtk_widget_unref()
> after you've added them back in a new location)

So I have to gtk_widget_ref( "Everything in that box" ), before I
gtk_container_remove( box )  ??

I'm not quite following this.  I have never used ref/unref before.  Does
this manage a counter to see if the widget is still in use? 

I noticed in the gtkcontainer.h file, there is a function called
gtk_container_children which returns a list of items, the children widgets
I'd assume.

Is it safe to just step through that list destroying them all, or would I
have to mess with unref/ref still?

+--------------------------------------+--------------------------------+
| -Dave                                | // Name that OS                |
| lndshark@megsinet.net                | #include <slow_crap.h>         |
+--------------------------------------+ #include <more_crap.h>         |
|       Visit The Hate Page!!!         | slow_t main()                  |
| http://doombbs.ml.org/~lndshark/hate | {return blue_screen_of_fun();} |
+--------------------------------------+--------------------------------+





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