search for: set_item_data

Displaying 15 results from an estimated 15 matches for "set_item_data".

Did you mean: get_item_data
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 delet...
2006 Nov 12
1
TreeCtrl item_data
The attached fixes set_item_data, get_item_data and some other methods for the TreeCtrl so they work nicely with Ruby objects and GC. In C++ Wx TreeCtrl item_data works differently from client_data in classes derived from ControlWithItems (eg Choice, ListCtrl). A one-to-one mapping of the way TreeCtrl works would mean that you...
2006 Dec 01
0
[766] trunk/wxruby2: Added item_data aliases for client_data functions, update doc & tests;
...* "ControlWithItems#select":#ControlWithItems_select </span><del>-* "ControlWithItems#set_client_data":#ControlWithItems_setclientdata -* "ControlWithItems#set_client_object":#ControlWithItems_setclientobject </del><ins>+* "ControlWithItems#set_item_data":#ControlWithItems_setitemdata </ins><span class="cx"> * "ControlWithItems#set_selection":#ControlWithItems_setselection </span><span class="cx"> * "ControlWithItems#set_string":#ControlWithItems_setstring </span><span cl...
2007 Sep 05
0
[ wxruby-Bugs-13676 ] xrc listctrl windows custom data crash
...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...
2007 Aug 24
1
Choice append
...e able to provide user data? to do this: ch = Wx::Choice.new() ch.append("pluto", 10) ch.append("pippo", 20) ch.append("paperino", 30) instead of this (the way i''ve found to get the same result): ch = Wx::Choice.new() id = ch.append("pluto") ch.set_item_data(id, 10) id = ch.append("pippo") ch.set_item_data(id, 20) id = ch.append("paperino") ch.set_item_data(id, 30) thank you. fabio. _______________________________________________ wxruby-users mailing list wxruby-users@rubyforge.org http://rubyforge.org/mailman/listinfo/wxruby-...
2004 Jul 16
2
TreeCtrl#get_item_data
Hi I saw from the ChangeLog that [get|set]_client_data was removed from ComboBox for 0.4.0 because the methods weren''t working properly. TreeCtrl#get_item_data still seems to be there. I was wondering if someone who understood the issue could say if TreeItemData might also be afflicted with the same problems? I seem to be segfaulting quite a bit (actually, on TreeEvt#get_item), but it
2006 Nov 30
0
[765] trunk/wxruby2: Fixed item_data functions for ListCtrl, plus test
...mp;nbsp&nbsp&nbsp&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&nbs...
2007 Apr 17
0
[970] branches/wxruby2/wxwidgets_282/doc/textile/controlwithitems.txtl: Fixed a few formatting and content errors.
...an><span class="cx"> untyped, client data pointer with the item. </span><span class="lines">@@ -252,7 +251,7 @@ </span><span class="cx"> </span><span class="cx"> h3(#ControlWithItems_setitemdata). ControlWithItems#set_item_data </span><span class="cx"> </span><del>- *set_item_data*(%(arg-type)Integer% n, %(arg-type)Object% data) </del><ins>+ *set_item_data*(%(arg-type)Integer% n, %(arg-type)Object% data) </ins><span class="cx"> </span><span...
2007 Apr 03
0
[943] trunk/wxsugar/lib/wx_sugar/enumerable_controls.rb: Fix bug with false positives from #find_string, bounds-checking for
...super :get_item_data, i </ins><span class="cx"> end </span><span class="cx"> </span><ins>+ # Sets the item data for +i+ to be +obj+ </ins><span class="cx"> def []=(i, obj) </span><del>- cwi.set_item_data(i, obj) </del><ins>+ super :set_item_data, i, obj </ins><span class="cx"> end </span><span class="cx"> end </span><span class="cx"> </span><span class="lines">@@ -101,12 +128,35 @@ </s...
2007 Mar 22
0
[912] trunk/wxsugar/lib: Overview documentation moved to lib/wx_sugar.rb
...-# Create and update menus without a mess of system ids -# [wx_classes] -# Useful ruby methods added to individual Wx classes. -# -# === Deprecated extensions -# -# This module is deprecated and will soon be removed. -# -# [itemdata.rb] -# Linking ruby objects with wx controls; use the -# get/set_item_data methods in core wxruby2 instead. - - </del><span class="cx"> %w[ accessors delayed_constructors event_connector </span><span class="cx"> keyword_constructors layout menu wx_classes ].each do | ext_feature | </span><span class="cx"&...
2006 Nov 16
0
[741] trunk/wxruby2: Fix get_item_data, hiding TreeItemData messiness, fix GC-ing (Alex Fenton)
...trls can be linked to non-GUI application objects by using the +item_data methods. Methods which add items to the tree all accept an +optional @item_data@ argument, which may be any normal Ruby +object. Alternatively, a Ruby object can be explicitly associated with a +TreeCtrl item by calling "set_item_data":#TreeCtrl_setitemdata . The +same Ruby object can later be retrieved from a TreeCtrlItemId by calling +"get_item_data":#TreeCtrl_getitemdata . + </ins><span class="cx"> h2. Win32 notes </span><span class="cx"> </span><span class=...
2004 Jun 23
1
some wxruby questions
so I''ve been using wxruby for a bit, and I have some questions. Before I start, I do want to say, that I am really liking wxruby, these questions are a result if really putting it through it''s paces. 1) how do you assign accelerator keys? this kind of works if I add a menu item like "&New\tCtrl-N", but this only works for commands in the menu, and for some
2007 Apr 02
0
[937] trunk/wxsugar/lib/wx_sugar/enumerable_controls.rb: Initial commit of enumerable_controls.rb
...i) + @cwi = cwi + end + end + + # A proxy class for the item_data functions. + class ItemDataCollection < ItemCollection + def each + cwi.each { | i | yield cwi.get_item_data(i) } + end + + def [](i) + cwi.get_item_data(i) + end + + def []=(i, obj) + cwi.set_item_data(i, obj) + end + end + + # A proxy class for classes that use get/set_string to set labels, + # inheriting from ControlWithItems. + class StringsCollection < ItemCollection + def each + cwi.each { | i | yield cwi.get_string(i) } + end + + def [](i) + cwi.get_string(i) +...
2006 Dec 03
0
[773] trunk/wxsugar/lib/wx_sugar/all.rb: Updated overview, deprecated itemdata
...enus without a mess of system ids </span><ins>+# [wx_classes] +# Useful ruby methods added to individual Wx classes. +# +# === Deprecated extensions +# +# This module is deprecated and will soon be removed. +# +# [itemdata.rb] +# Linking ruby objects with wx controls; use the +# get/set_item_data methods in core wxruby2 instead. </ins><span class="cx"> </span><span class="cx"> </span><del>-%w[ accessors delayed_constructors event_connector itemdata </del><ins>+%w[ accessors delayed_constructors event_connector </ins&...
2007 Apr 14
0
[965] branches/wxruby2/wxwidgets_282/doc/textile: Misc.
...tClientData; -therefore *set_client_data* is an alias in WxRuby for this method. THe </del><ins>+*Note* that in WxWidgets C++, this method is called SetClientData; +therefore *set_client_data* is an alias in WxRuby for this method. The </ins><span class="cx"> name *set_item_data* is preferred for clarity and consistency with the </span><span class="cx"> other classes such as "TreeCtrl":treectrl.html and </span><span class="cx"> "ListCtrl":listctrl.html which offer a similar feature. </span></span>&...