search for: ruby_obj

Displaying 5 results from an estimated 5 matches for "ruby_obj".

2006 Dec 05
0
[779] trunk/wxruby2: Added TreeCtrl#traverse method and documentation
...p;nbsp&nbsp&nbsp&nbsp&nbspif ( ruby_item_data != NULL ) -&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp { -&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspVALUE ruby_obj = ruby_item_data->GetRubyObject(); -&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsprb_gc_mark(ruby_obj); -&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp } - </del>&lt...
2007 Sep 05
0
[ wxruby-Bugs-13676 ] xrc listctrl windows custom data crash
...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; } ----------------------------...
2007 Sep 04
4
listctrl set_item_data
Hi, I have used set_item_data with ruby objects (an array) and got a crash. The reason is simple, the objects were deallocated by the GC. The easy solution would be to accept only long parameters (like the original interface). The hard is to play by the GC''s rules and increase the reference count and decrease on deletion. Regards, teki
2006 Nov 30
0
[765] trunk/wxruby2: Fixed item_data functions for ListCtrl, plus test
...;nbsplong item_data = self->GetItemData(row); +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspif ( item_data == 0 ) return Qnil; +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspreturn (VALUE)item_data; + } + + VALUE set_item_data(int row, VALUE ruby_obj) + { +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspif ( row < 0 || row >= self->GetItemCount() ) +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp { +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&...
2006 Nov 16
0
[741] trunk/wxruby2: Fix get_item_data, hiding TreeItemData messiness, fix GC-ing (Alex Fenton)
...p;nbsp&nbsp&nbsp&nbsp&nbspif ( ruby_item_data != NULL ) +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp { +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspVALUE ruby_obj = ruby_item_data->GetRubyObject(); +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsprb_gc_mark(ruby_obj); +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp } + +&nbsp&...