[wxruby-users] Different (tree) event behaviors across platforms

Alex Fenton alex at pressure.to
Thu Mar 13 15:11:59 EDT 2008


Hi

Chauk-Mean P wrote:
> I'm currently writing a simple outliner application as a tutorial on
> wxRuby (both will be soon released ;-) )
> I tested this application on Windows and Linux and found that the tree
> event behavior :
> - is sometime strange on each platform
> - is also different on each platform
>   
Thank you for the report and test cases. As you know wxWidgets wraps 
native controls and the native event loop, and there are some subtle 
differences sometimes. From experience I think there are more of these 
in TreeCtrl than anywhere else - it's probably because it's the most 
complex native-wrapped control.
> Even if I managed to take care of these differences in the
> application, I'm just wondering if :
> - they revealed some wxRuby issues ? wxWindows issues ?
> - or it is normal ? In this case, I'd really appreciate some
> links/documentation on these cross-platforms issues.
>   
In most cases they're wxWidgets issues, though ultimately the only way 
to verify this is to write a C++ sample. As for official docs, we're 
limited to what's in the wxWidgets docs, plus any annotations we make. 
In the past I've turned up useful confirmations of subtler 
cross-platform differences by searching for info on wxPython or C++ (eg 
by searching for wxTreeCtrl). The wxWiki sometimes also has info.

But usually it's just a question of coding round it, as you've done. 
Happy to apply patches that note these differences in our ruby docs.
> You will find attached the source codes and captures of the
> application on Windows and Linux (Fedora 8).
>
>   
I tried out your examples, and was able to reproduce the differences you 
describe.

> 3/ Run again outliner.rb :
> - create two root articles, create a child within the first root as
> shown in outliner_windows.jpg
> - close the application afterwards
>
> On Windows, you will see traces indicating that there are selection
> change events occuring during the close of the application ! On Linux,
> you don't have these events.
This might possibly be something fixable in wxRuby, but I'm not sure. 
There's a few places I've been surprised by ObjectPreviouslyDeleted 
errors where events are getting sent to destroyed objects. I wonder if 
wxRuby should try to explicitly disconnect event handlers on window 
deletion - but there's nothing in the C++ docs that suggests this.

cheers
alex



More information about the wxruby-users mailing list