Update to WxMorphic (v0.03alpha)

Steven Swerling sswerling at yahoo.com
Tue Mar 22 17:46:43 UTC 2005


Rob Gayvert wrote:
> Looking good.  So how did you fix the key events?  

The fix was to detect set a flag in the morphic panel, wantsKeyEvents, 
upon a mouse click there. This could be done on mouse motion events too, 
but right now it's just on the click. When a key event comes into a 
WxWidget, the morphic wrapper looks at this flag in its parent, the 
morphic panel. If the parent wantsKeyEvents, the key event is forwarded 
to the morphic panel, if not, it is processed normally. If there is a 
click in a wx widget, the wantsKeyEvents flag is cleared.

As sketchy as that sounds, I think it will likely be sufficient, and 
very few subclasses of WxMorphicWrapper will have to override the 
default key event handling. As this problem only crops up when WxWidgets 
are added as children to a WxMorphicPanel, I wouldn't expect the focus 
issue to come up very often anyway, except in the case of a 
UIBuilder/Editor. More typically in deployed applications, I would 
think, WxWidgets will be siblings of the morphic panel rather than 
children of it. We shall see.

>
> Are the embedded wrapper buttons initially gray because of the 
> performance issue? They have some additional display glitches, but 
> otherwise operate as expected (which, from a wx viewpoint, is very 
> unexpected).

This code is very green at this point. The wrappers are initially gray 
because they haven't had there picture taken yet (this happens the first 
time there is a halo click). Really I'm just playing around with the 
problem at this point. I had written a long note about the ins and outs 
of this, but I'm going to try a completely different approach pretty 
soon, with halos reimplemented as WxEllipses instead of as morphs, so 
that they pop up over the entire Morphic Panel. That way, no pictures 
need to be taken of the widgets, and the real WxWidgets will not need to 
be hidden during halo editing. Once I get that working, I can play 
around with that a bit and try to figure out the pros and cons of each 
approach.




More information about the Wxsqueak mailing list