Re: [Fxruby-users] Treelist -- can't add new items with data.
Status: Inactive
Brought to you by:
lyle
From: Hugh S. S. E. E. <hg...@dm...> - 2003-08-14 13:52:04
|
On Thu, 14 Aug 2003, Hugh Sasse Staff Elec Eng wrote: > Well you're right this time, it didn't result in any items getting > added to the tree. :-( further study shows from @add_cat_btn.connect(SEL_COMMAND) { data = EntryData.new(ops_panel,"New Category") result = NameEntryDialog.new(data).execute unless result.zero? newname = data.value.value #Which item was selected from the tree... if treelist.currentItem path = File.join(treelist.currentItem.full_path, Base36code.new($freelist.next).representation) puts "item is #{treelist.currentItem.inspect}, children=#{treelist.currentItem.numChildren}" @treeview[path] = treelist.addItemLast(treelist.currentItem, newname, nil, nil, TreeData.new(treelist, path)) puts "item is #{treelist.currentItem.inspect}, children=#{treelist.currentItem.numChildren}" treelist.recalc # tell treelist it has changed... # Message-ID: # <3F3...@cf...> else ; # raise "No item selected." end end } I get item is equipment, children=0 TreeData.new("/home/hgs/stores_loans/data/equipment/00b1bb0") ./stores_loans.rb:318:in `new' ./stores_loans.rb:318:in `initialize' ./stores_loans.rb:309:in `call' /usr/local/lib/ruby/site_ruby/1.6/fox/responder2.rb:57:in `onHandleMsg' ./stores_loans.rb:393:in `execute' ./stores_loans.rb:393:in `initialize' ./stores_loans.rb:388:in `call' /usr/local/lib/ruby/site_ruby/1.6/fox/responder2.rb:57:in `onHandleMsg' ./stores_loans.rb:461:in `run' ./stores_loans.rb:461 DirIndex.new("/home/hgs/stores_loans/data/equipment/00b1bb0" class: String) item is equipment, children=1 called catdialog.create() Which shows that the number of children is now 1, rather than 0, but none are displayed. Hugh |