Forum: wxRuby ListCtrl unexpected behavior

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Fabio P. (Guest)
on 2009-01-09 16:52
(Received via mailing list)
Hi,

using ListCtrl, I realized that, capturing the selection event by using
the
macro evt_list_item_selected, I get mistaken event of type ListItem
instead
of type ListEvent.
I noticed that this occurs when i use the keyboard arrow keys to move
through the list.

It can be shown in the example Bigdemo -> wxListCtrl_virtual causing the
error.

my environment is

wxruby-1.9.9-x86-mswin32-60, ruby 1.8.6
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
WinXP sp2

if i rememer well there was no problem with wxruby-1.9.8

regards,

bio.
Fabio P. (Guest)
on 2009-01-09 18:35
(Received via mailing list)
one more detail:

the error occurs only alternating mouse clicks and keyboard arrow keys
through the list.
Alex F. (Guest)
on 2009-01-10 00:49
(Received via mailing list)
Hi Fabio

Fabio P. wrote:
>
> wxruby-1.9.9-x86-mswin32-60, ruby 1.8.6
> ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
> WinXP sp2

Thanks for the report. I think that at the root this is the same bug
that others were encountering with Scintilla event handlers, which is
now fixed in SVN. I will try and reproduce using the ListCtrl on Windows
(the bug depends partly on how the OS allocates memory blocks).

Useful to know that it wasn't a problem in 1.9.8 - will check see if any
other classes might have this problem. It will be fixed for 2.0

cheers
alex
Chauk-Mean P. (Guest)
on 2009-01-10 01:34
(Received via mailing list)
Hi,

2009/1/9 Alex F. <removed_email_address@domain.invalid>:
>> It can be shown in the example Bigdemo -> wxListCtrl_virtual causing the
>> error.
>
> Thanks for the report. I think that at the root this is the same bug that
> others were encountering with Scintilla event handlers, which is now fixed
> in SVN.

FYI, it works fine for me with the latest revision in SVN.

Cheers,

Chauk-Mean.
Alex F. (Guest)
on 2009-01-10 02:03
(Received via mailing list)
Chauk-Mean P wrote:
>> Thanks for the report. I think that at the root this is the same bug that
>> others were encountering with Scintilla event handlers, which is now fixed
>> in SVN.
>>
>
> FYI, it works fine for me with the latest revision in SVN.

Cool, thanks.

I took another look at our SWIG wxRuby_WrapWxEventInRuby function and
there's something in there which could potentially still cause these
errors where an event handler receives an odd type of object instead of
the correct Event object.

I'll put a patch in to make it watertight, although it may well be that
the commonest route for these memory mess-ups is already plugged.

cheers
alex
This topic is locked and can not be replied to.