Re: [gnomemm] libglademm: reparenting to a Gnome::UI::App class



On Mon, 2003-01-20 at 20:14, Bryan Forbes wrote:
> 	refXml = Gnome::Glade::Xml::create("gcdburn.glade");
> 	refXml->reparent_widget("bonobodock1", *this);
> 	refXml->reparent_widget("appbar1", *this);

How would reparent_widget() know where to put these 2 child widgets? I
think reparent_widget() assumes that a simple add() is possible.

> this example, although seemingly logical, will compile, but when run, it gives these
> errors:
> (gcdburn:8507): Gtk-WARNING **: Attempting to add a widget with type BonoboDock
> to a gtkmm__GnomeApp, but as a GtkBin subclass a gtkmm__GnomeApp can only contain one
> widget at a time; it already contains a widget of type GtkVBox
>  
> (gcdburn:8507): Gtk-WARNING **: Attempting to add a widget with type gtkmm__GnomeAppBar
> to a gtkmm__GnomeApp, but as a GtkBin subclass a gtkmm__GnomeApp can only contain one
> widget at a time; it already contains a widget of type GtkVBox

So this makes sense.

> but I've found a solution which is kind of elusive.  Instead of reparenting the children
> of the GnomeApp (the appbar and bonobodock) from the glade file to the Gnome::UI::App
> (*this), you need to reparent them to dynamic_cast<Gtk::Container&>(*get_child()).  To
> me, that just doesn't make sense.  Is this something that's wrong in libglademm, or am I
> missing something?  Or is this supposed to be a feature?  Thanks in advance.

Well, I don't know how you should add a Bonobo::Dock or AppBar at
runtime without libglademm anway. It would make sense to investigate
that. I don't the the get_child() "child" is meant to contain these.

-- 
Murray Cumming
murray usa net
www.murrayc.com




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