[gnomemm] Gtkmm nautilus property pages cleanup



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 :?
    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)

--
Roger Ferrer Ibáñez
Correu: rofi ya com
Correu (FIB): b4270692 est fib upc es
Correu (Casa): roger pinchito com
Correu (JEDI): rogerf jedi upc es



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