search for: get_item_data

Displaying 20 results from an estimated 21 matches for "get_item_data".

2006 Nov 30
0
[765] trunk/wxruby2: Fixed item_data functions for ListCtrl, plus test
...quot;>@@ -36,10 +39,53 @@ </span><span class="cx"> </span><span class="cx"> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspreturn returnVal; </span><span class="cx"> } </span><ins>+ + VALUE get_item_data(int row) + { +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspif ( row < 0 || row >= self->GetItemCount() ) return Qnil; +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsplong item_data = self->GetItemData(row); +&nbsp&nbsp&nbs...
2006 Dec 01
0
[766] trunk/wxruby2: Added item_data aliases for client_data functions, update doc & tests;
...t_client_data":#ControlWithItems_getclientdata -* "ControlWithItems#get_client_object":#ControlWithItems_getclientobject </del><span class="cx"> * "ControlWithItems#get_count":#ControlWithItems_getcount </span><ins>+* "ControlWithItems#get_item_data":#ControlWithItems_getitemdata </ins><span class="cx"> * "ControlWithItems#get_selection":#ControlWithItems_getselection </span><span class="cx"> * "ControlWithItems#get_string":#ControlWithItems_getstring </span><span cl...
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 disappears when I don''t use item_data. The methods are easy e...
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 would have to...
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 Sep 20
3
Bug? in wxSugar enumerable_controls.rb
...wx_classes/enumerable_controls.rb'' as following : def each(&block) last = get_count - 1 case block.arity when 1 0.upto(last) { | i | yield i } when 2 0.upto(last) { | i | yield i, get_string(i) } when 3 0.upto(last) { | i | yield i, get_string(i), get_item_data(i) } else raise ArgumentError, "Invalid number of block parameters" end end This method works well if used directly. The problem is that methods from Enumerable like find_all, collect ... calls the each method providing a block with an arity of -1 ! (I''m running...
2006 Nov 16
0
[741] trunk/wxruby2: Fix get_item_data, hiding TreeItemData messiness, fix GC-ing (Alex Fenton)
...px solid #ccc;margin:10px 0;} #patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;} #patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;} #patch .lines, .info {color:#888;background:#fff;} --></style> <title>[741] trunk/wxruby2: Fix get_item_data, hiding TreeItemData messiness, fix GC-ing (Alex Fenton)</title> </head> <body> <div id="msg"> <dl> <dt>Revision</dt> <dd>741</dd> <dt>Author</dt> <dd>brokentoy</dd> <dt>Date</dt> <dd>2006-11-...
2007 Apr 03
0
[943] trunk/wxsugar/lib/wx_sugar/enumerable_controls.rb: Fix bug with false positives from #find_string, bounds-checking for
...string(value, true) ) && i > -1 </ins><span class="cx"> return i </span><span class="cx"> end </span><span class="cx"> indices = (0 ... get_count).to_a </span><del>- return indices.find { | i | get_item_data(i) == value } </del><ins>+ return indices.find { | i | get_item_data(i) == value } </ins><span class="cx"> end </span><span class="cx"> </span><span class="cx"> # Appends this string to the control </span>&...
2007 Apr 02
0
[937] trunk/wxsugar/lib/wx_sugar/enumerable_controls.rb: Initial commit of enumerable_controls.rb
...more efficient to iterate over the indexes only. + def each(&block) + last = get_count - 1 + case block.arity + when 1 + 0.upto(last) { | i | yield i } + when 2 + 0.upto(last) { | i | yield i, get_string(i) } + when 3 + 0.upto(last) { | i | yield i, get_string(i), get_item_data(i) } + else + raise ArgumentError, "Invalid number of block parameters" + end + end + + # Returns the index of the item in the control corresponding to + # +value+. +value+ may be a string label, or it may be any ruby object + # set as client data to a list item. Returns +n...
2007 Sep 05
0
[ wxruby-Bugs-13676 ] xrc listctrl windows custom data crash
...entation 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 &lt...
2006 Nov 26
0
[759] trunk/wxruby2/Changelog: Roy & Alex''s recent fixes and additions
...Give more info on failed assertions but don''t raise exception (Alex Fenton) +- Corrected some typemapped method signatures in documentation (Alex Fenton) </ins><span class="cx"> - Un-disabled evt_toolbar on Linux and OS X (Alex Fenton) </span><del>-- Fixed get_item_data and mem mgmt for TreeCtrl (Alex Fenton) </del><ins>+- Fixed TreeCtrl#get_item_data and mem mgmt (Alex Fenton) </ins><span class="cx"> - Added get_client_data support for all ControlWithItems + test case (Alex Fenton) </span><span class="cx"> -...
2004 Jun 23
1
some wxruby questions
...his true? and if not, is there a work around? MODERN fonts are NOT fixed width, especially on debian 3) Are there some memory problems with tree control? I instantiate a tree control, add some items and then if I call this code several minutes later, I often get a seg fault : get_item_data(get_selection).absolute_filename (where absolute_filename is a method on the item data) this works, for a while and then it starts seg faulting. I''m guessing that somewhere the ruby garbage collection is prematurely collecting these items? has anyone else seen this. It''s re...
2006 Nov 21
0
[744] trunk/wxruby2: get_data support & mem mgmt to all ControlWithItems types, using more
....3) + end + + def test_treectrl_itemdata + f = CtrlContainerFrame.new(Wx::TreeCtrl) + root = f.control.add_root(''foo'') + + id = f.control.append_item(root, ''a hash'', -1, -1, { :a => 7 }) + assert_equal({:a => 7 }, + f.control.get_item_data(id) ) + + id = f.control.prepend_item(root, ''a float'', -1, -1, 7.8) + assert_equal(7.8, + f.control.get_item_data(id) ) + + id = f.control.prepend_item(root, ''an array'', -1, -1, %w|foo bar baz|) + GC.start + assert_equal(%w|foo bar...
2007 Sep 04
0
[ wxruby-Bugs-13640 ] Invalid value for TreeCtrl#get_root_id when TR_HIDE_ROOT style is set (MSW)
...ed to: Alex Fenton (brokentoy) Summary: Invalid value for TreeCtrl#get_root_id when TR_HIDE_ROOT style is set (MSW) Initial Comment: When a TreeCtrl is created with the TR_HIDE_ROOT style, the id values returned by add_root and get_root_id are invalid (-65636) - if passed back into get_item_text , get_item_data, item_has_children etc nothing is returned. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=218&aid=13640&group_id=35
2008 Nov 14
1
GenericDirCtrl#re_create_tree behaviour
Hi When GenericDirCtrl#re_create_tree is called in order to refresh the tree with any possible changes made to the file system since it was loaded, it doesn''t re-expand all the tree items that were expanded prior to calling re_create_tree. I''m working on a solution to note all open tree items and after re_create_tree manually expand the items that are still present in the tree.
2004 Aug 10
7
HTML Widget
Hi, I''m pretty new to WxRuby, but I think it is the ideal solution to write Ruby-applications for different platforms. I missed the wxHtmlWindow in WxRuby, so I added it myself. You can grab the new files from http://portfolio16.de/tmp/wxruby-html.tar.gz. This archive contains all files I added to the wxruby-directory. These are mostly the *.t files for the missing classes and some
2007 Dec 30
1
ReOrdering Wx::TreeCtrl Items
Given the following hash: #... @project_list = { ''Contract0'' => nil, ''Contract1'' => { ''Project1'' => nil, ''Project2'' => nil, ''Project3'' => { ''task1'' =>
2006 Nov 21
0
[747] trunk/wxruby2/Changelog: get_item stuff, evt_toolbar, also correct a commit from 0.0.37 that I missed
...bsp&nbsp&nbsp&nbsp&nbsp&nbsp2006-11-21 22:30:19 UTC (rev 747) </span><span class="lines">@@ -1,3 +1,7 @@ </span><ins>+- Corrected some typemapped method signatures (Alex Fenton) +- Un-disabled evt_toolbar on Linux and OS X (Alex Fenton) +- Fixed get_item_data and mem mgmt for TreeCtrl (Alex Fenton) +- Added get_client_data support for all ControlWithItems + test case (Alex Fenton) </ins><span class="cx"> - Ensure that all lib files are included in gem and tarball (Sean Long/Alex Fenton) </span><span class="cx"&gt...
2007 Apr 02
0
[940] trunk/wxsugar/lib/wx_sugar/wx_classes/treectrl.rb: Align #traverse usage with #each in enumerable_controls.rb
....call(start_item) </del><ins>+ case block.arity + when 1 + block.call(start_item) + when 2 + block.call(start_item, + get_item_text(start_item)) + when 3 + block.call(start_item, + get_item_text(start_item), + get_item_data(start_item)) + else + raise ArgumentError, "Invalid number of block parameters" + end + </ins><span class="cx"> if has_children(start_item) </span><span class="cx"> child, cookie = get_first_child(start_item) </span>&l...
2007 Oct 09
17
Crash when using item data with a CheckListBox
...ot;five"] data = ["data1", "data2", "data3", "data4", "data5"] lb = Wx::ListBox.new(helloframe) # lb = Wx::CheckListBox.new(helloframe) 0.upto(4) { |i| lb.append(choices[i], data[i]) } evt_listbox lb do |event| puts lb.get_item_data(event.index) end helloframe.show end end HelloWorld.new.main_loop When an item is selected, the corresponding data is ouput. If the list box is replaced by a check list box, the application crashes immediately. Cheers. Chauk-Mean.