On Sat, Mar 13, 2004 at 03:35:47AM -0800, Scott Beck wrote: > Hola, > > Currently I am working on a Perl client class for Y Windows > (http://www.y-windows.org). My Y class currently acts like a > POE::Component in that it creates it's own session and passes events > back to the calling session. I am looking for a way to propagate events > up to different widgets if the event is not handled in the widget it was > for. Right now I am using this hack:
[hack] In the widget libraries I've worked with, some master Application class handles outside events and dispatches them to appropriate widgets. They find the appropriate keystroke target by walking down a focus chain, from screen (always focused) -> window (whichever is on top) -> widget (which one has the cursor). Mouse clicks reach their destination by a simple form of ray casting: The Z order chain is walked front to back (top to bottom?) until the click point intersects with something. I think these sorts of specialized event dispatch systems are best implemented outside POE. Applications can become very large if every button, checkbox, text string, panel, and box is a separate session. Response time will be displeasing if keystrokes and mouse clicks must propagate through a queue several times. I've written the beginnings of a Curses based widget library for POE. If I remember properly, it illustrates the keystroke focus chain but doesn't have mouse support. -- Rocco Caputo - [EMAIL PROTECTED] - http://poe.perl.org/
