Re: [gnomemm] Gtkmm nautilus property pages cleanup



On Friday 09 July 2004 20:17, Ole Laursen wrote:
> Murray Cumming <murrayc murrayc com> writes:
>
> [...]
>
> > Are you really really sure that it does not inherit from Gtk::Window?
>
> I have the same problem with panel applets. In my case, the top level
> widget is a PanelApplet (C type) with a gtkmm Gtk::EventBox inside.
>
> I've never gotten around to investigating the problem because it only
> appears when the panel is shut down or the applet dies (and then the
> standard output most often ends up a place where I don't notice it).
>
> The factory construction method looks like this (where my custom
> Applet class derives from Gtk::EventBox):
>
>   gboolean hardware_monitor_factory(PanelApplet *panel_applet, const gchar
> *iid, void *)
>   {
>     // construct applet
>     Applet *applet = manage(new Applet(panel_applet));
>     applet->show();
>
>     gtk_container_add(GTK_CONTAINER(panel_applet),
> GTK_WIDGET(applet->gobj())); gtk_widget_show(GTK_WIDGET(panel_applet));
>
>     return true;
>   }

By way of more background data, I found the same thing with a Gtk::EventBox 
within a system tray ("notification area") container (which uses the 
GtkPlug/GtkSocket interface, but I just adopted the libegg trayicon 'C' stuff 
to save having to write my own system tray code).  I got the message whenever 
the event box was unembedded (unplugged) from from the libegg systray 
container - that is, whenever the "destroy" signal was emitted.  It didn't 
occur when the event box was first plugged in (that is, when the "embedded" 
signal was emitted).

I spent some time trying to trace it - from instrumentation I added it was 
definitely calling the Gtk::Window overridden version of manage() but I just 
couldn't work out how it could possibly happen.  I looked at the reference 
counting code and couldn't find anything wrong.  Program execution was fine, 
but it was just calling Gtk::Window::manage() for no apparent reason at all.

Although program execution was fine I got a bit fed up with the bizarre 
behaviour and went down to the C level and used a GtkEventBox, and that 
worked fine.  (If you want to look at the code read through tray_icon.cpp in 
http://prdownloads.sourceforge.net/efax-gtk/efax-gtk-2.2.8a.src.tgz?download ).

Chris.



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