diff options
| author | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-07-23 16:07:35 +0000 |
|---|---|---|
| committer | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-07-23 16:07:35 +0000 |
| commit | ef3e52e3c1cd81d6a631b4f28f82b7f1be78f459 (patch) | |
| tree | c77c6520287d10d2abab0f6e119d8eb5d7e36a80 /ext/tk/lib/tkfont.rb | |
| parent | 00eb7c80420cc05b4750eaa7529d762cf89f0fbd (diff) | |
| download | ruby-ef3e52e3c1cd81d6a631b4f28f82b7f1be78f459.tar.gz ruby-ef3e52e3c1cd81d6a631b4f28f82b7f1be78f459.tar.xz ruby-ef3e52e3c1cd81d6a631b4f28f82b7f1be78f459.zip | |
process.c : unify indentation
configure.in : add --enable-setreuid option
tcltklib.c : TclTkIp.new accepts 'ip-name' and 'options'
( e.g. TclTkIp.new('FOO', '-geometry 500x200 -use 0x2200009') )
tk.rb : support arguments of TclTkIp.new
( see TkCore::IP_NAME, TkCore::IP_OPTS )
tk*.rb : preparations for multi-Tk interpreter support
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/lib/tkfont.rb')
| -rw-r--r-- | ext/tk/lib/tkfont.rb | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/ext/tk/lib/tkfont.rb b/ext/tk/lib/tkfont.rb index 4dfdd7a71..68eb91039 100644 --- a/ext/tk/lib/tkfont.rb +++ b/ext/tk/lib/tkfont.rb @@ -9,17 +9,16 @@ class TkFont include Tk extend TkCore - Tk_FontID = [0] - Tk_FontNameTBL = {} - Tk_FontUseTBL = {} + TkCommandNames = ['font'.freeze].freeze - TkComm.__add_target_for_init__(self) + Tk_FontID = ["@font".freeze, "00000"] + Tk_FontNameTBL = TkCore::INTERP.create_table + Tk_FontUseTBL = TkCore::INTERP.create_table - def self.__init_tables__ + TkCore::INTERP.init_ip_env{ Tk_FontNameTBL.clear Tk_FontUseTBL.clear - Tk_FontID[0] = 0 - end + } # set default font case Tk::TK_VERSION @@ -222,8 +221,8 @@ class TkFont private ################################### def initialize(ltn=DEFAULT_LATIN_FONT_NAME, knj=nil, keys=nil) - @id = format("@font%.4d", Tk_FontID[0]) - Tk_FontID[0] += 1 + @id = Tk_FontID.join + Tk_FontID[1].succ! Tk_FontNameTBL[@id] = self knj = DEFAULT_KANJI_FONT_NAME if JAPANIZED_TK && !knj create_compoundfont(ltn, knj, keys) |
