Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 1999-09

Event Box usage....

3 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Samuel Liddicott
to Shane Miller: I proposed using an eventbox about 20 emails ago for this purpose. The problem that I…
Show quoted text 10 lines
-----Original Message----- From: Shane Miller Sent: Friday, September 03, 1999 01:58 AM To: Subject: [lazarus] Event Box usage.... I proposed using an eventbox about 20 emails ago for this purpose. The problem that I see is it's overhead. It adds alot to the resource overhead.

Only when there are events. Which isn't often.

However, it does give us the assurance that all components will be able to handle certain types of events. Plus we only need the eventbox for certain components, as others basically have their own built in.

Cool

Show quoted text 6 lines
All we need to do is when the control is created, if it is a certain type, create an eventbox, and then create the component. do a gtk_object_set_data and set the 'COMPONENT' to this button, label or whatever. That way we can access it through the eventbox.

Sounds good to me.

Sam

Reply by email

Michael A. Hess
to Shane Miller: I proposed using an eventbox about 20 emails ago for this purpose. The problem that I…
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. http://www.miraclec.com

Reply by email

Shane Miller

I proposed using an eventbox about 20 emails ago for this purpose. The problem that I see is it's overhead. It adds alot to the resource overhead. However, it does give us the assurance that all components will be able to handle certain types of events. Plus we only need the eventbox for certain components, as others basically have their own built in.

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 the eventbox doesn't get the events, then we still couldn't use the evnetbox to handle all the before and after stuff.

I'm sure we'll think of a way around that.

All we need to do is when the control is created, if it is a certain type, create an eventbox, and then create the component. do a gtk_object_set_data and set the 'COMPONENT' to this button, label or whatever. That way we can access it through the eventbox.

Thoguhts...

------------------------------------------------------------ Shane Miller

Home page : http://www.lakefield.net/~smiller

Auto-IP Publisher : http://www.lakefield.net/~smiller/autoip

Advanced Clipboard : http://www.lakefield.net/~smiller/advclipboard

Lazarus : http://www.miraclec.com/lazarus
----------------------------------------------------------

Reply by email