summaryrefslogtreecommitdiff
path: root/ext/tk/lib/tkextlib
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-05-25 11:09:59 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-05-25 11:09:59 +0000
commit90537dbe3c152388032608f6f63b23f1762235d0 (patch)
tree7bd98bc813709be8c7282fb0fac6c2664bec901a /ext/tk/lib/tkextlib
parentac5925d2ab40061fd30369049105dc38b9039ebf (diff)
* ext/tk/lib/tk.rb: TkComm#tk_split_*list fail to split a kind of SJIS
strings. To avoid the trouble, add arguments to control converting encoding, and do split on a UTF8 string. * ext/tk/lib/multi-tk.rb: modify to attend encoding. * ext/tk/lib/remote-tk.rb: ditto. * ext/tk/lib/tk/itemconfig.rb: ditto. * ext/tk/lib/tk/listbox.rb: ditto. * ext/tk/lib/tk/namespace.rb: ditto. * ext/tk/lib/tk/panedwindow.rb: ditto. * ext/tk/lib/tk/text.rb: ditto. * ext/tk/lib/tk/textmark.rb: ditto. * ext/tk/lib/tk/texttag.rb: ditto. * ext/tk/lib/tk/variable.rb: ditto. * ext/tk/lib/tk/winfo.rb: ditto. * ext/tk/lib/tkextlib/iwidgets/scrolledlistbox.rb: ditto. * ext/tk/lib/tkextlib/iwidgets/scrolledtext.rb: ditto. * ext/tk/lib/tk.rb: add TkWindow#lower_window/raise_window and Tk#lower_window/raise_window by reason of method-name conflict * ext/tk/lib/tk/canvas.rb: bug fix on TkCanvas#delete when given non-TkcItem arguments. * ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/lib/tkextlib')
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb4
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scrolledlistbox.rb4
-rw-r--r--ext/tk/lib/tkextlib/iwidgets/scrolledtext.rb30
3 files changed, 26 insertions, 12 deletions
diff --git a/ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb b/ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb
index e949955a31..2a6f3a71b6 100644
--- a/ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb
@@ -163,7 +163,9 @@ class Tk::Iwidgets::Scrolledcanvas
def delete(*args)
if TkcItem::CItemID_TBL[self.path]
find('withtag', *args).each{|item|
- TkcItem::CItemID_TBL[self.path].delete(item.id)
+ if item.kind_of?(TkcItem)
+ TkcItem::CItemID_TBL[self.path].delete(item.id)
+ end
}
end
tk_send_without_enc('delete', *args.collect{|t| tagid(t)})
diff --git a/ext/tk/lib/tkextlib/iwidgets/scrolledlistbox.rb b/ext/tk/lib/tkextlib/iwidgets/scrolledlistbox.rb
index ef98979aed..a60059f744 100644
--- a/ext/tk/lib/tkextlib/iwidgets/scrolledlistbox.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/scrolledlistbox.rb
@@ -125,7 +125,9 @@ class Tk::Iwidgets::Scrolledlistbox
end
def get(first, last=nil)
if last
- tk_split_simplelist(_fromUTF8(tk_send_without_enc('get', first, last)))
+ # tk_split_simplelist(_fromUTF8(tk_send_without_enc('get', first, last)))
+ tk_split_simplelist(tk_send_without_enc('get', first, last),
+ false, true)
else
_fromUTF8(tk_send_without_enc('get', first))
end
diff --git a/ext/tk/lib/tkextlib/iwidgets/scrolledtext.rb b/ext/tk/lib/tkextlib/iwidgets/scrolledtext.rb
index bfff6804d2..8e4162aaf2 100644
--- a/ext/tk/lib/tkextlib/iwidgets/scrolledtext.rb
+++ b/ext/tk/lib/tkextlib/iwidgets/scrolledtext.rb
@@ -137,15 +137,19 @@ class Tk::Iwidgets::Scrolledtext
if slot
case slot.to_s
when 'text', 'label', 'show', 'data', 'file'
- conf = tk_split_simplelist(_fromUTF8(tk_send_without_enc('image', 'configure', _get_eval_enc_str(index), "-#{slot}")))
+ #conf = tk_split_simplelist(_fromUTF8(tk_send_without_enc('image', 'configure', _get_eval_enc_str(index), "-#{slot}")))
+ conf = tk_split_simplelist(tk_send_without_enc('image', 'configure', _get_eval_enc_str(index), "-#{slot}"), false, true)
else
- conf = tk_split_list(_fromUTF8(tk_send_without_enc('image', 'configure', _get_eval_enc_str(index), "-#{slot}")))
+ #conf = tk_split_list(_fromUTF8(tk_send_without_enc('image', 'configure', _get_eval_enc_str(index), "-#{slot}")))
+ conf = tk_split_list(tk_send_without_enc('image', 'configure', _get_eval_enc_str(index), "-#{slot}"), 0, false, true)
end
conf[0] = conf[0][1..-1]
conf
else
- tk_split_simplelist(_fromUTF8(tk_send_without_enc('image', 'configure', _get_eval_enc_str(index)))).collect{|conflist|
- conf = tk_split_simplelist(conflist)
+ #tk_split_simplelist(_fromUTF8(tk_send_without_enc('image', 'configure', _get_eval_enc_str(index)))).collect{|conflist|
+ # conf = tk_split_simplelist(conflist)
+ tk_split_simplelist(tk_send_without_enc('image', 'configure', _get_eval_enc_str(index)), false, false).collect{|conflist|
+ conf = tk_split_simplelist(conflist, false, true)
conf[0] = conf[0][1..-1]
case conf[0]
when 'text', 'label', 'show', 'data', 'file'
@@ -173,16 +177,20 @@ class Tk::Iwidgets::Scrolledtext
if slot
case slot.to_s
when 'text', 'label', 'show', 'data', 'file'
- conf = tk_split_simplelist(_fromUTF8(tk_send_without_enc('image', 'configure', _get_eval_enc_str(index), "-#{slot}")))
+ #conf = tk_split_simplelist(_fromUTF8(tk_send_without_enc('image', 'configure', _get_eval_enc_str(index), "-#{slot}")))
+ conf = tk_split_simplelist(tk_send_without_enc('image', 'configure', _get_eval_enc_str(index), "-#{slot}"), false, true)
else
- conf = tk_split_list(_fromUTF8(tk_send_without_enc('image', 'configure', _get_eval_enc_str(index), "-#{slot}")))
+ #conf = tk_split_list(_fromUTF8(tk_send_without_enc('image', 'configure', _get_eval_enc_str(index), "-#{slot}")))
+ conf = tk_split_list(tk_send_without_enc('image', 'configure', _get_eval_enc_str(index), "-#{slot}"), 0, false, true)
end
key = conf.shift[1..-1]
{ key => conf }
else
ret = {}
- tk_split_simplelist(_fromUTF8(tk_send_without_enc('image', 'configure', _get_eval_enc_str(index)))).each{|conflist|
- conf = tk_split_simplelist(conflist)
+ #tk_split_simplelist(_fromUTF8(tk_send_without_enc('image', 'configure', _get_eval_enc_str(index)))).each{|conflist|
+ # conf = tk_split_simplelist(conflist)
+ tk_split_simplelist(tk_send_without_enc('image', 'configure', _get_eval_enc_str(index)), false, false).each{|conflist|
+ conf = tk_split_simplelist(conflist, false, true)
key = conf.shift[1..-1]
case key
when 'text', 'label', 'show', 'data', 'file'
@@ -235,7 +243,8 @@ class Tk::Iwidgets::Scrolledtext
end
def image_names
- tk_split_simplelist(_fromUTF8(tk_send_without_enc('image', 'names'))).collect{|elt|
+ #tk_split_simplelist(_fromUTF8(tk_send_without_enc('image', 'names'))).collect{|elt|
+ tk_split_simplelist(tk_send_without_enc('image', 'names'), false, true).collect{|elt|
tagid2obj(elt)
}
end
@@ -250,7 +259,8 @@ class Tk::Iwidgets::Scrolledtext
end
def mark_names
- tk_split_simplelist(_fromUTF8(tk_send_without_enc('mark', 'names'))).collect{|elt|
+ #tk_split_simplelist(_fromUTF8(tk_send_without_enc('mark', 'names'))).collect{|elt|
+ tk_split_simplelist(tk_send_without_enc('mark', 'names'), false, true).collect{|elt|
tagid2obj(elt)
}
end