Re: [inti] OptionMenu width ?

Bo Lorentsen <[email protected]> Mon, 05 Jan 2004 11:25:22 +0100
Newsgroups gmane.comp.gnome.inti
Organization hjem
Message-ID <[email protected]>
Jeff Franks wrote:

> Each widget class has two completely different ways to respond to a 
> GTK signal. You can connect to it using the proxy signals (e.g. 
> sig_clicked() in Gtk::Button). This method does not require you to 
> declare your own class, you can just use one of the standard widget 
> classes, "out of the box" so-to-speak. The other way is to derive your 
> own class from  a standard widget and override one or more of its 
> virtual signal handlers. The thing about these virtual signal handlers 
> is that they're already connected. you don't need to explicitly 
> connect to them. That's what all the _proxy functions are for in the 
> soucre (cc) files. The logic behind moving all the virtual signal 
> handlers into an interface class that needs to multiplley inherited is 
> that it removes the memory slug for all those widgets that you don't 
> need all those virtual functions. If you are going to write this

Ahh, so the proxy classes in the EntryEvent class, not only define a 
slot/proxy but also connect them, I din't know that.

I see you do this connection in the EntryClass::init, but then what have 
You achived ? The interface as somewhat smaller, but the proxy classes 
still need to be called, and some runtime fee have to be payed, or am I 
still missing the point ?

How does en EntryEvent class connect to the proxies, I don't se it ?

>
> class MyEntry : public Gtk::Entry
> {
> };
>
> surely it's not too much effort to write this instead:
>
> class MyEntry : public Gtk::Entry, public Gtk::EntrySignals
> {
> };
>
> If you are deriving you own classes then I think you should override 
> the virtual signal handlers since they are already hooked into the GTK 
> signal emission system. You get them for free.

Yeps, but not much are saved either, as I can se it !

> I've never seen a major library that ever uses this file extension, 
> only the odd program. If you remember my reason for not previously 
> using inline functions then I suppose there is no reason why I 
> shouldn't use hh.

Anything other than .h will make me happy, but its not that important.

/BL



-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click