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

Chauk-Mean P chauk.mean at gmail.com
Tue Mar 11 20:03:21 EDT 2008


Hi all,

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

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.

You will find attached the source codes and captures of the
application on Windows and Linux (Fedora 8).

So the symptoms :
1/ Run outliner_wo_check.rb
Clicking on the 'Add Root' button, creates an item and allow the
edition of its label.
On Windows, this works as expected. You can click several times and
everything is fine.
On Linux, this does not work. Sometimes, the editing of the label is
not ended by the selection (through code) of another item. See the
outliner_linux_wo_check.jpg capture.

To fix this Linux issue, I added some checks to know if a label is
being edited and to ensure that the editing is ended before adding
items.

2/ Run outliner.rb
If I create a root article, there are 2 selection change events on
Windows (strange) and only one on Linux (as expected).
See outliner_linux.jpg and outliner_windows.jpg.

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 time for 2/ and 3/ I had to write code to face these strange
things on Windows.

Thanks in advance for any help/clarification.

Cheers.

Chauk-Mean.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: outliner_wo_check.rb
Type: application/x-ruby
Size: 4537 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20080312/0237122f/attachment-0002.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: outliner_linux_wo_check.jpg
Type: image/jpeg
Size: 51602 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20080312/0237122f/attachment-0003.jpg 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: outliner.rb
Type: application/x-ruby
Size: 4528 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20080312/0237122f/attachment-0003.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: outliner_win.jpg
Type: image/jpeg
Size: 53115 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20080312/0237122f/attachment-0004.jpg 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: outliner_linux.jpg
Type: image/jpeg
Size: 39896 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/wxruby-users/attachments/20080312/0237122f/attachment-0005.jpg 


More information about the wxruby-users mailing list