🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.eiffel
Article #1546

event handler

#1546
From: Marc van Daele
Date: Thu, 08 Feb 1990 13:47
40 lines
2275 bytes
Can someone explain me how events flow from a button up to his parents?

I started with the class comm_button.e, in which I removed the
pay_attention (button_release) instruction.
Instead I putted a button_release_action and a button_press_action
in the window class from which my comm_button class inherited.
Then I created a window, with a button on it (using the jogger example in
~/Eiffel/examples/graphics/animation)

If I click on the button, a button_press event is sent to the button (correct).
If I release, nothing happens, while I expected a button_release event to be 
sent to the window.  WHY ?
Furthermore, if I click (without releasing) and then leave the button,
TWO leave_notify events are sent.  WHY ?
If I click on the window itself, there is a button_press event sent to the 
window (correct) and when I release, a button_release is sent to the window 
(also correct).

If I remove the pay_attention (button_press) in the button class, we get the
following running around of messages.
If I click on the button, a button_press event is send to the window AND 
a leave_notify event is sent to the button.  Leaving the button causes
no extra sending of events.
If I release the button, a button_release event is sent to the window AND
an enter_notify event is sent to the button.

Why is there a button_release event sent to the window in the second case, 
and not in the first case , while the pay_attention (button_press) instruction
should not effect the sending of button_release events ?

Can somebody explain me the logic behind this ?

disclaimer : IF this is a stupis question THEN I'm a novice eiffel user

-------------------------------------------------------------------------------
Marc Van Daele
vdaele@cst.prl.philips.nl

If you're no part of the solution, you're part of the problem
Technical Details
Message-ID: <952@prles2.prl.philips.nl>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcsun!hp4nl!phigate!prle!prles2!cstw35!vdaele

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcsun!hp4nl!phigate!prle!prles2!cstw35!vdaele
From: vdaele@cstw35.prl.philips.nl (Marc van Daele)
Newsgroups: comp.lang.eiffel
Subject: event handler
Message-ID: <952@prles2.prl.philips.nl>
Date: 8 Feb 90 13:47:42 GMT
Sender: news@prles2.prl.philips.nl
Reply-To: vdaele@cst.prl.philips.nl (Marc van Daele)
Organization: Centre for Software Technology, Philips Eindhoven
Lines: 40