[lazarus] Event Box usage....

Michael A. Hess mhess at miraclec.com
Thu Sep 2 19:53:32 EDT 1999


Shane Miller wrote:
> 
> If you add an eventbox under a button so the button's parent is the
> eventbox, and you click on the button, who gets the event?  The
> eventbox or the button?  That's the only problem.

If I understand the mechanism correctly the button would get the event.
Using the example of a Label in an eventbox the label actually gets the
event but it doesn't have any handlers to deal with it so it passes it
up to it's parent which is the eventbox and it handles it. So in the
case of a button in an eventbox the button would get the event and
handle it so it would never pass it up to the parent.

Now I'm not sure if when you respond to a callback telling it that you
handled the event does that kill the event? I don't think so. I think
you have to use the gtk_signal_emit_stop_by_name to get it to not
propagate the event to other objects.

So does the default button handler do this so that the eventbox it is
sitting in doesn't also get the event?

I'm not real sure how any of this works.   :-\

-- 
==== Programming my first best destiny! ====

Michael A. Hess      Miracle Concepts, Inc.
mhess at miraclec.com   http://www.miraclec.com






More information about the Lazarus mailing list