Event handling with nested containers
Marc Strämke <[email protected]> Thu, 11 Sep 2003 09:19:31 +0200
| Newsgroups | gmane.comp.embedded.stk.gui.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi team , We might run into some big trouble with our current solution of event handling. One of the recent changes of darren made widget's screen coordinates relative to their parent's, this means that a widget cannot determine where it lives on the screen, but when handling pointer events, it has to do exactly this! My current proposal for this would be to create a method pass_event_downwards in stk::event_handler so that each container my offset the mouse coordinates and give the event to his active child. This seems really ugly, doesnt it? In my source tree i've implemented a function in container stk::point get_screen_position that recursively calls itself on the parent until it reaches state, so the widget can get the screen position of its parent. Please give me some feedback which method you like or dislike, i'll commit the one chosen then (this affects all handle event functions of all widget b t w *g*) BTW: Is there any reason for drawing before checking the event sources in the mainloop? This gives us a few jitties worse response time to user 's interaction.