Re: [Fwd: connecting to signal_focus_out_event with additional parameters]



Hello,

I tryed it, and it seems to compile/link/run properly, like:

bool on_entry_focus_out (GdkEventFocus *focus,Gtk::Entry *entry)
{
}

void MyClass::MyMethod ()
{
...............

mDVSSThresholdE.signal_focus_out_event ().connect(sigc::bind<Gtk::Entry *>(sigc::ptr_fun (&on_entry_focus_out),&mDVSSThresholdE));
........
}

where mDVSSThresholdE is


class MyClass : .....
{
........
Gtk::Entry mDVSSThresholdE;
........
};class

i guess the parameter to the bind is not the address of an entry, have you check it?

Greetings,
Luca



Bob Caryl wrote:
I forgot to mention this:

I have three different *arrays* of Gtk::Entry object pointers, each of which contains six members that must be connected to the signal_focus_out_event signal and be vetted as explained below, hence I cannot know which Gtk::Entry generated the event without further data.

Bob

-------- Original Message --------
Subject: connecting to signal_focus_out_event with additional parameters
Date:     Thu, 20 Oct 2005 08:41:21 -0500
From:     Bob Caryl <bob fis-cal com>
To:     gtkmm-list <gtkmm-list gnome org>



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

_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list


_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list





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