Re: GtkButton inside a GtkEventBox : how to receive mouse events on both?



On Mon, 2008-09-29 at 17:56 +0200, Yannick Barbeaux wrote:
> I am writing a graphic library that encapsulates Gtkmm and 
> I want to be able to catch any mouse click (with any mouse button), on
> all the widgets of this library 
> So as to make it as general as possible, I put my widgets in an
> EventBox and catch the events on it. 
> 
> The problem I face is the following: 
> when I put a toggleButton (for example) as the child of my EventBox,
> I am able to catch the mouse button event either on the toggleButton
> (if I call "eventBox->set_above_child(false)") or on the eventBox (if
> I call "eventBox->set_above_child(true)")
> but not on both... 
> I thought that returning false at the end on my callback
> MyGtkToggleButton::on_my_button_pressed(GdkEventButton *event) would
> propagate the event to the parent (e.g. my EventBox) but that does not
> work.

the event box makes no point whatsoever. every button has its own window
to receive events - you just need to set the event mask for the button.






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