Re: maemomm: virtual function overrides



On Sun, 2007-11-11 at 07:50 +0000, John Steele Scott wrote:
> I have a Gtkmm application which uses a custom widget derived from 
> Gtk::DrawingArea. This widget overrides the virtual functions of the 
> parent, such as e.g.:
> 
> void PlotCanvas::on_realize()
> {
>   Gtk::DrawingArea::on_realize();
> 
>   // do some other stuff . . .
> }
> 
> This works fine on my Ubuntu Gutsy machine, but when I try to compile 
> this in the Maemo sandbox, it fails because there is no 
> Gtk::DrawingArea::on_realize(). Similarly, other such signal handlers are 
> never called, it seems that they need to be explicitly connected via 
> their signal proxies.
> 
> Since I'm new to Gtkmm, I'd like to know: is this difference due to the 
> version of Gtkmm in Ubuntu Gutsy being much newer than the version in 
> Maemo Bora, or is it a core difference between the Hildon and vanilla 
> versions of Gtkmm? (I imagine it might be the latter, to save code size.)

It's exactly that. Default signal handlers are, among other API,
disabled in maemo to save code size. It shouldn't be much of a deal,
though, since you just can do something like

#ifndef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
signal_realize().connect(sigc::mem_fun(*this, &PlotCanvas::on_realize));
#endif

in your constructor. It gets trickier if you want to override GObject
vfuncs (those that end in _vfunc() in gtkmm).

Armin

> If the difference is due to the version number of Gtkmm, in which version 
> did this feature (virtual functions for signals) get included in Gtkmm? 
> Does the Maemo Chinook version of Gtkmm have overridable virtual 
> functions?
> 
> cheers,
> 
> John
> 
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list



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