Hi,
OSX 10.6.7 w/ wxRuby 2.0.1 from rubyforge, reproducible on Windows 7.
I’m using a Wx::CheckListBox with
- LB_MULTIPLE
- LB_NEEDED_SB
- LB_SINGLE
- LB_SORT
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
handler.
This is my remedy code:
def on_select_list event
index = event.get_index()
@checklistbox.get_selections().each {|x| @checklistbox.deselect x }
@checklistbox.select index
# … do stuff here
end
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
- CLB empty
- append (“bbb”, hash 2)
- 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?
Thanks,
T