[SOLVED w/ workaround] BUG:Events not bubbled
Posted: Wed Feb 09, 2011 23:20
Short description: CEGUI does not bubble/propagate events as expected. I expect the up/down arrow keys to page through the history whenever the Console window or any of its child windows has input focus. Also, I expect F12 to always toggle the Console no matter where the input focus is unless another control is expected to 'eat' the event and stop event bubbling/propagation. I am fairly confident this is a bug because it is easy to reproduce with Sample_FalagardDemo1.exe from the CEGUI binary demos. Also don't forget to check out my Python port of the Falagard Demo at the end of this post~
Setup:
I discovered this bug while developing a graphical Python-interpreter shell. The goal is to be able to call PyCEGUI functions from the shell and immediately see their effects! The current code is simply a port of the Falagard console demo. However, it provides the base code for any PyCEGUI application.
Notes:
Code for Python port of Falagard demo updated in this post.
Setup:
- Start Sample_FalagardDemo1.exe
- Click the Console window's editBox to give focus
- Press 1, ENTER, 2, ENTER, 3, ENTER to seed the history multiline editbox with some input
- Press UPARROW
- Click on the Console window title bar (or anywhere else inside the Console window but outside its child windows)
- Press UPARROW, UPARROW (twice)
- Press F12
- Nothing
- Text cursor disappears (as expected)
- Console window's editbox text changed to '3'
- Nothing
- Console windows's editbox text changed to '3'
- Text cursor disappears (as expected)
- Console window's editbox contents changed to '2', then '1'
- Console window is hidden
- This bug also reproduces with a PyCEGUI port of the Falagard demo (attached below). Additionally, F12 does not toggle the Console directly after clicking the Console title (which does work with the binary demo).Even after modifying the event handlers to always return False, the events are not propagated.
- Originally I thought this was just a problem with the CEGUI Python bindings (exception messages associated with the event callback methods seem to indicate the callback method return value is None, i.e. ignored), but it seems to be a problem in both the bindings and CEGUI library.
- Windows 7
- Python 2.6.6
- PyCEGUI 0.7.5 for Python 2.6
I discovered this bug while developing a graphical Python-interpreter shell. The goal is to be able to call PyCEGUI functions from the shell and immediately see their effects! The current code is simply a port of the Falagard console demo. However, it provides the base code for any PyCEGUI application.
Notes:
- class PyCeguiGlutBaseApp is roughly equivalent to C++ class CEGuiOpenGLBaseApplication
- class PyFalagardDemo is roughly equivalent to C++ class FalagardDemo1Sample
- class Console is roughly equivalent to C++ class DemoConsole
- there is some basic debug information logged to the (real Windows OS) console when keyboard events are injected
- function pprint_attributes() is a handy method to inspect the nested objects from the PyCEGUI API
Code for Python port of Falagard demo updated in this post.