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 | fd46a1da0a41b7939424bc5a393027be7940908e (patch) | |
tree | c77c6520287d10d2abab0f6e119d8eb5d7e36a80 /ext/tk/lib/tktext.rb | |
parent | 528b6c3f6470cc24d6d5d39f0b573c76a74cc5c9 (diff) | |
download | ruby-fd46a1da0a41b7939424bc5a393027be7940908e.tar.gz |
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@4127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/lib/tktext.rb')
-rw-r--r-- | ext/tk/lib/tktext.rb | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/ext/tk/lib/tktext.rb b/ext/tk/lib/tktext.rb index f23744af22..34663f35b4 100644 --- a/ext/tk/lib/tktext.rb +++ b/ext/tk/lib/tktext.rb @@ -28,6 +28,7 @@ class TkText<TkTextWin include TkTreatTextTagFont include Scrollable + TkCommandNames = ['text'.freeze].freeze WidgetClassName = 'Text'.freeze WidgetClassNames[WidgetClassName] = self @@ -765,15 +766,10 @@ end class TkTextTag<TkObject include TkTreatTagFont - TTagID_TBL = {} - Tk_TextTag_ID = ['tag0000'] + TTagID_TBL = TkCore::INTERP.create_table + Tk_TextTag_ID = ['tag', '00000'] - TkComm.__add_target_for_init__(self) - - def self.__init_tables__ - TTagID_TBL.clear - Tk_TextTag_ID[0] = 'tag0000' - end + TkCore::INTERP.init_ip_env{ TTagID_TBL.clear } def TkTextTag.id2obj(text, id) tpath = text.path @@ -787,11 +783,11 @@ class TkTextTag<TkObject end @parent = @t = parent @tpath = parent.path - @path = @id = Tk_TextTag_ID[0] + @path = @id = Tk_TextTag_ID.join TTagID_TBL[@id] = self TTagID_TBL[@tpath] = {} unless TTagID_TBL[@tpath] TTagID_TBL[@tpath][@id] = self - Tk_TextTag_ID[0] = Tk_TextTag_ID[0].succ + Tk_TextTag_ID[1].succ! #tk_call @t.path, "tag", "configure", @id, *hash_kv(keys) if args != [] then keys = args.pop @@ -974,15 +970,10 @@ class TkTextTagSel<TkTextNamedTag end class TkTextMark<TkObject - TMarkID_TBL = {} - Tk_TextMark_ID = ['mark0000'] + TMarkID_TBL = TkCore::INTERP.create_table + Tk_TextMark_ID = ['mark', '00000'] - TkComm.__add_target_for_init__(self) - - def self.__init_tables__ - TMarkID_TBL.clear - Tk_TextMark_ID[0] = 'mark0000' - end + TkCore::INTERP.init_ip_env{ TMarkID_TBL.clear } def TkTextMark.id2obj(text, id) tpath = text.path @@ -996,7 +987,7 @@ class TkTextMark<TkObject end @parent = @t = parent @tpath = parent.path - @path = @id = Tk_TextMark_ID[0] + @path = @id = Tk_TextMark_ID.join TMarkID_TBL[@id] = self TMarkID_TBL[@tpath] = {} unless TMarkID_TBL[@tpath] TMarkID_TBL[@tpath][@id] = self |