Re: [gnomemm] Gtkmm nautilus property pages cleanup



On Fri, 2004-07-09 at 17:30 +0200, Roger Ferrer Ib�z wrote:
> Hi,
> 
> I'm writing a property page for Nautilus. So I have an application that
> registers the factory object and does all bonobo-related stuff. The
> interface is done with a Gtk::VBox. The property page itself is not the
> problem, it correctly appears and it works fine in Nautilus.
> 
> My problem occurs when cleaning up the object created in the factory.
> The code is as follows :
> 
> static BonoboObject* control_factory (BonoboGenericFactory *instance,
>              const char           *req_iid,
>              void                 *data)
> {
>      // Initial "classic" stuff checking the req_iid value goes here
> 
>      // EicielMainControler is a helper class
>      EicielMainControler* eiciel_controller = new EicielMainControler();
>      Gtk::Widget* widget;
> 
>      // Eiciel Window inherits from Gtk::VBox (don't get confused)
>      // I don't know if Gtk::manage here is correct :?

Are you really really sure that it does not inherit from Gtk::Window?

You can not manage Windows because manage() means "the child widget will
be destroyed its container is destroyed. But Windows are not child
widgets and they are not in any container."

If you don't find a solution, then it might be best to put the code
online somewhere.

>      EicielWindow* eiciel =
>           Gtk::manage(
>              new EicielWindow(eiciel_controller));
>      widget = eiciel;
> 
>      BonoboControl* control = bonobo_control_new(widget->gobj());
> 
>      // Property bag stuff needed by nautilus goes here.
>      return BONOBO_OBJECT(control);
> }
> 
> I've set one std::cerr message in the constructor and destructor of
> EicielWindow class to see when they're called.
> 
> In order to debug I start the program with the same parameters that OAF
> uses (something like "--oaf-activate-iid=OAFIID:Eiciel_Component_Fabrica
> --oaf-ior-fd=43") and it reports that the object EicielWindow is
> constructed everytime you open a property page. That's OK.
> 
> But when you close the property window, it never reports being
> destroyed. When closing (and only if you had shown the property page
> that the component provides) it also appears the following warning:
> 
> (eiciel_bonobo:5777): gtkmm-WARNING **: gtkmm: Attempt to call
> Gtk::manage() on a Gtk::Window, but a Gtk::Window has no parent
> container to manage its lifetime.
> 
> which i don't understand because EicielWindow does not inherit from
> Gtk::Window but Gtk::VBox. If you didn't show the property page then no
> warning appears nor destruction message.
> 
> I've also tried using libbonobouimm and Gnome::Bonobo::Servers::Control
> as in the example that comes in the source. It works but it yields the
> same behaviour.
> 
> What am I doing wrong ?
> 
> Thank you!
> 
> (P.S.: If it can be useful gtkmm is 2.2.11 and gnome is 2.6.1)



-- 
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com




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