Re: [inti] entry fun
Jeff Franks <[email protected]> Mon, 05 Jan 2004 14:28:26 +1100
| Newsgroups | gmane.comp.gnome.inti |
|---|---|
| Message-ID | <[email protected]> |
Bo Lorentsen wrote: > Hi ... > > I have tryed to play with a entry widget in order to take over control > of what will and may be entered into it, and I found that one way to > do this could be the function "on_insert_at_cursor" on entry (not > ideal, as it tells me after and not before an char have been entered). > But this gave me some problems, as the default function are not called > (message filter ?), and when I tried to engage my own, I found that > the definition in the ref.doc. was somewhat wrong ... I think. > > I says that the function should look like this : void > on_insert_at_cursor (const String &text) > > But the compiler only accepts this : > > void on_insert_at_cursor( const char *pszText ) > > a doc. bug ? > > Well anyway, non of this helped, so maybe I misunderstood the purpose > of this signal, or maybe it does not work. > 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: Gtk::Entry *entry = new Gtk::Entry(); Gtk::Editable *editable = dynamic_cast<Gtk::Editable*>(entry); editable->sig_insert_text().connect(slot(this, &MyWindow::my_insert_text_handler)); Regards, Jeff. ------------------------------------------------------- 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