Re: connect_notify weirdness, once again...



On Sun, 2005-04-10 at 12:35, Matthias Kaeppler wrote:
[...deleted...]

> Is this also the case for the signal_button_press_event?
> Because I am connecting (not connect_notify'ing) a signal handler which 
> returns a boolean to that signal, and it is never called.
> OTOH, this signal handler (handling mouse button presses) doesn't sound 
> to be "rare":
> 
> class MyWidget: public Gtk::ScrolledWindow
> {
> public:
>      bool on_button_press_event( GdkEventButton* );
> // ...
> private:
>      Gtk::TreeView view_;
> // ...
> }
> 
> // ...
> view_.signal_button_press_event().connect( sigc::mem_fun( *this, 
> &MyWidget::on_button_press_event ) );
> 
> The signal handler is never called. I have to declare it void and 
> connect with connect_notify().
> I still don't get the point.
> 
> PS: Can you also reply to my other post regarding signal handlers in 
> general, i.e. when signal_button_press_event is fired if I have an 
> overlapping view and a widget, which both can fire this event.
> 
> 
> Thanks in advance.

in your c'tor try this:

add_events (Gdk::BUTTON_PRESS_MASK);

	/** 'false' argument tells Gtk+ to call on_key_pressed() BEFORE
		keypress event handling. Returning 'true' from
                on_key_pressed() will stop event processing.
	*/
signal_key_press_event ().connect(
	sigc::mem_fun (*this, &MyWidget::on_key_pressed), false);

-- 
_____________________________________________________________
Vladislav Grinchenko       http://home.comcast.net/~3rdshift/
                                 e-mail: 3rdshift comcast net
                                                   
      Focus on quality, and productivity will follow.
_____________________________________________________________




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