Re: gtk_container_replace function.



On 19 Jun 2001, Owen Taylor wrote:

> 
> Chema Celorio <chema ximian com> writes:
> 
> > I had to hack a function to replace a widget inside a container for
> > another widget, I am suggesting moving this functionality into gtk
> > because i have seen a couple of apps hack a similar functionality.
> > The prototype will be :
> > 
> > gtk_container_replace (GtkContainer *container, GtkWidget *old_widget,
> > GtkWidget *new_widget);
> > 
> > I have solved _my_ problem already, but i believe this functionality
> > will be better off inside gtk. When apps have to hack a function like
> > this they end up messing with the internals of the widgets/containers
> > and we should avoid it if possible.
> 
> Can you propose how you would implement this function? 

gnome-libs has a function like this as well, iirc.
basically all child properties are captured, the container
is exchanged, and if possible, the recorded child properties
are re-set on the new container (at least those whose names/types
match the new container).
i doubt the general usefullness of this though, and have to say
that i never came across a situation where i _really_ needed
this functionality.

> When would you want to do this in an normal application? (Most
> applications that want to do something like this simply use a box
> containing both, and hide/show as needed.)
> 
> Regards,
>                                         Owen
> 

---
ciaoTJ





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