search for: setitemdata

Displaying 3 results from an estimated 3 matches for "setitemdata".

Did you mean: getitemdata
2006 Nov 30
0
[765] trunk/wxruby2: Fixed item_data functions for ListCtrl, plus test
...ing(bool isSmall) const; </span><span class="cx"> </span><ins>+// dealt with below </ins><span class="cx"> %ignore wxListCtrl::GetItem(wxListItem& info) const; </span><ins>+%ignore wxListCtrl::GetItemData; +%ignore wxListCtrl::SetItemData; </ins><span class="cx"> </span><span class="cx"> %extend wxListCtrl { </span><span class="cx"> VALUE get_item(int row, int col = -1) </span><span class="lines">@@ -36,10 +39,53 @@ </span><span class...
2007 Sep 05
0
[ wxruby-Bugs-13676 ] xrc listctrl windows custom data crash
...( 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
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