Forum: wxRuby Wx::CheckListBox (maybe all ControlsWithItems?) oddities

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
53ba108ecb05f9e1d67084cc51d2661e?d=identicon&s=25 Chloro F. (tony44)
on 2011-06-07 00:33

OSX 10.6.7 w/ wxRuby 2.0.1 from rubyforge, reproducible on Windows 7.

I'm using a Wx::CheckListBox with


I can reproduce the following behavior:

1.) Single selection doesn't work. No matter what I do, the CheckListBox
will always add to the selection, even when completely without an event

This is my remedy code:

  def on_select_list event
    index = event.get_index()
    @checklistbox.get_selections().each {|x| @checklistbox.deselect x } index
    # ... do stuff here

2.) The sorting algorithm will sort the listbox strings but, while
auto-sorting after an append(string label, void clientdata), lose
association with the client (void) data.

Example scenario
1) CLB empty
2) append ("bbb", hash 2)
3) append ("aaa", hash 1)

after these three operations, the CLB always looks like

[0] string: "aaa" / data: hash 2
[1] string: "bbb" / data: hash 1

What am I doing wrong?

This topic is locked and can not be replied to.