noreply at rubyforge.org
2007-Sep-05 04:01 UTC
[wxruby-development] [ wxruby-Bugs-13676 ] xrc listctrl windows custom data crash
Bugs item #13676, was opened at 2007-09-05 14:01 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=218&aid=13676&group_id=35 Category: Incorrect behavior Group: current Status: Open Resolution: None Priority: 3 Submitted By: Bela Babik (teki321) Assigned to: Nobody (None) Summary: xrc listctrl windows custom data crash Initial Comment: I have attached the source and the xrc files. Double click on any line to get the crash: $ ./wxb.rb ./wxb.rb:28: [BUG] Segmentation fault ruby 1.8.6 (2007-03-13) [i386-mswin32] This application has requested the Runtime to terminate it in an unusual way. Please contact the application''s support team for more information.>From the documentation:Boolean set_item_data(Integer item, Integer data) Integer get_item_data(Integer item) They shouldn''t accept non integer data. Right now this is accepted: @lst.set_item_data(x,[x,x]) I don''t know how it supposed to work, but it seems that the ruby object is converted to long and then back (ListCtrl.i): VALUE get_item_data(int row) { if ( row < 0 || row >= self->GetItemCount() ) return Qnil; long item_data = self->GetItemData(row); if ( item_data == 0 ) return Qnil; return (VALUE)item_data; } VALUE set_item_data(int row, VALUE ruby_obj) { if ( row < 0 || row >= self->GetItemCount() ) { rb_raise(rb_eIndexError, "Uninitialized item"); } long item_data = (long) ruby_obj; bool result = self->SetItemData(row, item_data); if ( result ) return Qtrue; return Qnil; } ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=218&aid=13676&group_id=35
Apparently Analagous Threads
- [765] trunk/wxruby2: Fixed item_data functions for ListCtrl, plus test
- listctrl set_item_data
- [741] trunk/wxruby2: Fix get_item_data, hiding TreeItemData messiness, fix GC-ing (Alex Fenton)
- TreeCtrl item_data
- [766] trunk/wxruby2: Added item_data aliases for client_data functions, update doc & tests;