aboutsummaryrefslogtreecommitdiffstats
path: root/ext/tk/sample/tktree.rb
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-07-15 01:18:57 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-07-15 01:18:57 +0000
commitce1b23b7a5a496f4b6d3ad4627a161b1dc6945fe (patch)
treed7dca8b035286a8a852c021318fa04a4efa43aa8 /ext/tk/sample/tktree.rb
parent6c6a24826c5fda68e04e71ac17620b0e70bca265 (diff)
downloadruby-ce1b23b7a5a496f4b6d3ad4627a161b1dc6945fe.tar.gz
* ext/tk/, ext/tcltklib/: bug fix
* ext/tk/lib/tk.rb: better operation for SIGINT when processing callbacks. * ext/tk/lib/tk/msgcat.rb: ditto. * ext/tk/lib/tk/variable.rb: ditto. * ext/tk/lib/tk/timer.rb: ditto. * ext/tk/lib/tk/validation.rb: add Tk::ValidateConfigure.__def_validcmd() to define validatecommand methods easier * ext/tk/lib/tk.rb (_genobj_for_tkwidget): support autoload Tk ext classes * ext/tk/lib/tk/canvas.rb and so on: remove the parent widget type check for items (e.g. canvas items; depends on the class) to avoid some troubles on Tk extension widget class definition. * ext/tk/lib/tkextlib/: add Iwidget and TkTable extension support * ext/tk/sample/tkextlib/: add samples of Iwidget and TkTable git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6630 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/sample/tktree.rb')
-rw-r--r--ext/tk/sample/tktree.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/ext/tk/sample/tktree.rb b/ext/tk/sample/tktree.rb
index 6379635a5d..bcb94d3601 100644
--- a/ext/tk/sample/tktree.rb
+++ b/ext/tk/sample/tktree.rb
@@ -18,8 +18,10 @@ class TkTree < TkCanvas
args = [@path]
if keys.kind_of?(Hash)
font = keys.delete('itemfont')
+# font = hash_kv(font) if font.kind_of?(Hash)
keys['font'] = font if font
- args.concat(hash_kv(keys))
+# args.concat(hash_kv(keys))
+ args << keys
end
begin
tk_call('::tktree::treecreate', *args)
@@ -33,8 +35,10 @@ class TkTree < TkCanvas
if keys.kind_of?(Hash)
keys = _symbolkey2str(keys)
font = keys.delete('itemfont')
+# font = hash_kv(font) if font.kind_of?(Hash)
keys['font'] = font if font
- tk_call('::tktree::newitem', @path, itempath, *hash_kv(keys))
+# tk_call('::tktree::newitem', @path, itempath, *hash_kv(keys))
+ tk_call('::tktree::newitem', @path, itempath, keys)
else
tk_call('::tktree::newitem', @path, itempath)
end
@@ -80,7 +84,7 @@ EOL
}
f = TkFrame.new.pack(:expand=>true, :fill=>:both)
- tr2 = TkTree.new(f, :bg=>'black', :itemfont=>{:family=>'Times', :size=>14},
+ tr2 = TkTree.new(f, :bg=>'black', #:itemfont=>{:family=>'Times', :size=>14},
:textcolor=>'red', :bd=>4, :relief=>:ridge,
:selectbackground=>'darkBlue', :selectforeground=>'yellow',
:selectborderwidth=>3, :linecolor=>'yellow') {