RE: [gtkmm] Converting from GTK+ to Gtkmm



> Roger Leigh <roger whinlatter uklinux net> writes:
> 
> > Murray Cumming Comneon com writes:
> > 
> > > 1. With libglademm, you need to manually connect your 
> signals after getting
> > > the widgets from the Gnome::Glade::Xml. There is no 
> autoconnect yet.
> > 
> > OK.  Is this planned for the future?
> 
> I think it is in that sense that every time someone asks about it,
> Murray replies that it is worthwhile, and that someone ought to look
> at it (and then usually suggest that the person asking for it looks
> into it).
> 
> But actually I don't see how - if you restructure your application to
> have a proper OO structure as hinted in "Programming with gtkmm", you
> most often need to connect signals to specific objects. It would need
> quite some amount of ingenuity to make auto-connection work with that.
> Truth is it's only a minor hassle once you get used to it.

And I ususually reply that this feature was in libglademm 1 and might or
might not have worked and someone should look at it.

> > This is my class (which I think is the correct way to do things in
> > Gtkmm):
> 
> Yeah, it's at least one way. Some (mostly minor) comments:
> 
> > class ogcalc : public Gtk::Window
> > {
> > public:
> >   ogcalc();
> >   virtual ~ogcalc();
> > 
> > protected:
> >   // Signal handlers
> >   virtual void calculate(); // Calculation callback
> >   virtual void reset();     // Reset callback
> 
> I think it's odd that you make these virtual, since I wouldn't have
> thought the class would be suitable as a base class (but then I don't
> know you design intentions).

Lots of people think that all methods should be virtual. No rule is totally
practical though.

[snip]

Murray Cumming
murrayc usa net
www.murrayc.com 



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