Displaying 4 results from an estimated 4 matches for "getitemcount".
2006 Nov 30
0
[765] trunk/wxruby2: Fixed item_data functions for ListCtrl, plus test
...bsp      return returnVal;
</span><span class="cx"> }
</span><ins>+
+ 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;
+      &a...
2007 Sep 05
0
[ wxruby-Bugs-13676 ] xrc listctrl windows custom data crash
...dn''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"...
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
2007 Jan 23
0
[851] trunk/wxruby2/swig/classes/ListCtrl.i: Don''t try and mark item data for virtual ListCtrls, b/c it can crash
...nbsp  if ( wx_lc->GetWindowStyle() & wxLC_VIRTUAL )
+         return;
+
</ins><span class="cx">         int count = wx_lc->GetItemCount();
</span><span class="cx">         if ( count == 0 ) return;
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>