Re: [inti] entry fun

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

> Try connecting the the Gtk::Editable::sig_insert_text() or deriving 
> your own Entry and override the Gtk::Editable::on_insert_text() 
> handler. Don't forget Gtk::Entry is also a Gtk::Editable through 
> mutliple inheritance. You could connect to your own handler like this:

Thanks, this was just what I needed. I will remember to look more 
carefull into my parent classes befor asking next time !

I was begining to look into then GtkEvent structure, in pure panik :)

> Gtk::Entry *entry = new Gtk::Entry();
> Gtk::Editable *editable = dynamic_cast<Gtk::Editable*>(entry);

Dynamic cast are only needed when downcasting, right ?

> editable->sig_insert_text().connect(slot(this, 
> &MyWindow::my_insert_text_handler));

Thanks, and for inti 1.x I could just make a local version of  
"on_insert_text (const String &text, int *position)", as this one is 
connected by the Editable class constructor ?!?

/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