connecting to signal_focus_out_event with additional parameters



Hi guys,

I'm trying to connect to Gtk::Entry::signal_focus_out_event() so that I can vet the contents of the Gtk::Entry when it loses focus. I tried doing it the normal way:

myentry->signal_focus_out_event().connect(sigc::mem_fun(*this,&MyClass::on_entry_focus_out))

where on_entry_focus_out is prototyped thus:

bool MyClass::on_entry_focus_out(GdkEventFocus *focus);

My problem is that the GdkEventFocus::window member is merely a pointer to a GdkWindow drawable (and I also tried casting the result of gdk_parent_window(focus->window) to a Gtk::Entry * and it still caused a seg fault when run), and doesn't give me access to my Gtk::Entry from which the connection was originally made, so I tried doing this:

myentry->signal_focus_out_event().connect(sigc::bind<Gtk::Entry *>(sigc::mem_fun(*this,&MyClass::on_entry_focus_out),myentry));

where on_entry_focus out is prototyped thus:

bool MyClass::on_entry_focus_out(GdkEventFocus *focus,Gtk::Entry *entry);

This construct compiles, but the linker has big problems with it.

Can someone point to me a URL that will illustrate the error of my ways? I really didn't want to do this at all, but my boss insists on this idiot-proofing vetting process for the data entered here.

Thanks,

Bob Caryl




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