diff options
author | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-09-02 05:04:30 +0000 |
---|---|---|
committer | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-09-02 05:04:30 +0000 |
commit | 9388ed284d600f2225a745dfb3edb6ac1758fdb8 (patch) | |
tree | 1b7b09cfaa93e97d9e38389ddec7657418aa17ac /ext/tk/lib/tkcanvas.rb | |
parent | 645d4abf426fb2ef4ae72d0d46c24607b71be3a8 (diff) | |
download | ruby-9388ed284d600f2225a745dfb3edb6ac1758fdb8.tar.gz |
* ext/tcltklib/tcltklib.c (ip_invoke): fixed bug on passing a exception
* ext/tk/lib/{tk.rb, tkcanvas.rb, tkfont.rb, tktext.rb} :
bug fix and improvement of font control
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/lib/tkcanvas.rb')
-rw-r--r-- | ext/tk/lib/tkcanvas.rb | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/ext/tk/lib/tkcanvas.rb b/ext/tk/lib/tkcanvas.rb index 9e386ee50d..024211aa1d 100644 --- a/ext/tk/lib/tkcanvas.rb +++ b/ext/tk/lib/tkcanvas.rb @@ -212,11 +212,17 @@ class TkCanvas<TkWindow when 'text', 'label', 'show', 'data', 'file', 'maskdata', 'maskfile' tk_send 'itemcget', tagid(tagOrId), "-#{option}" when 'font', 'kanjifont' - fnt = tk_tcl2ruby(tk_send('itemcget', tagid(tagOrId), "-#{option}")) + #fnt = tk_tcl2ruby(tk_send('itemcget', tagid(tagOrId), "-#{option}")) + fnt = tk_tcl2ruby(tk_send('itemcget', tagid(tagOrId), '-font')) unless fnt.kind_of?(TkFont) fnt = tagfontobj(tagid(tagOrId), fnt) end - fnt + if option.to_s == 'kanjifont' && JAPANIZED_TK && TK_VERSION =~ /^4\.*/ + # obsolete; just for compatibility + fnt.kanji_font + else + fnt + end else tk_tcl2ruby tk_send('itemcget', tagid(tagOrId), "-#{option}") end @@ -227,7 +233,7 @@ class TkCanvas<TkWindow key = _symbolkey2str(key) if ( key['font'] || key['kanjifont'] \ || key['latinfont'] || key['asciifont'] ) - tagfont_configure(tagOrId, key.dup) + tagfont_configure(tagid(tagOrId), key.dup) else tk_send 'itemconfigure', tagid(tagOrId), *hash_kv(key) end @@ -237,7 +243,11 @@ class TkCanvas<TkWindow key == 'kanjifont' || key == :kanjifont || key == 'latinfont' || key == :latinfont || key == 'asciifont' || key == :asciifont ) - tagfont_configure(tagid(tagOrId), {key=>value}) + if value == None + tagfontobj(tagid(tagOrId)) + else + tagfont_configure(tagid(tagOrId), {key=>value}) + end else tk_send 'itemconfigure', tagid(tagOrId), "-#{key}", value end @@ -750,7 +760,7 @@ class TkcItem<TkObject @id = create_self(*args).to_i ;# 'canvas item id' is integer number CItemID_TBL[@path] = {} unless CItemID_TBL[@path] CItemID_TBL[@path][@id] = self - font_configure(fontkeys) unless fontkeys.empty? + configure(fontkeys) unless fontkeys.empty? ######## old version # if args[-1].kind_of? Hash |