summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-11-21 07:49:11 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-11-21 07:49:11 +0000
commitcf971d47b97844352faf31ae9da6f6806b3af7e1 (patch)
tree59f9d01ec766496730532bbba81eaa3ac64aae65 /ext
parentef85e302c84975ebb94b3556cb51380c9963b7c4 (diff)
* ext/tk/lib/tkentry.rb: fix the encoding trouble of percent
substitutions on validatecommand option of TkEntry widget * ext/tk/lib/tk.rb: fix bug on {pack|grid}_propagate() method git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/tk/lib/tk.rb8
-rw-r--r--ext/tk/lib/tkentry.rb9
2 files changed, 12 insertions, 5 deletions
diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb
index 9c7a0982c2..cec589047f 100644
--- a/ext/tk/lib/tk.rb
+++ b/ext/tk/lib/tk.rb
@@ -4053,8 +4053,8 @@ class TkWindow<TkObject
return info
end
- def pack_propagate(mode = nil)
- if mode
+ def pack_propagate(mode=None)
+ if mode == None
tk_call('pack', 'propagate', epath, mode)
else
bool(tk_call('pack', 'propagate', epath))
@@ -4141,8 +4141,8 @@ class TkWindow<TkObject
list(tk_call('grid', 'location', epath, x, y))
end
- def grid_propagate(mode=nil)
- if mode
+ def grid_propagate(mode=None)
+ if mode == None
tk_call('grid', 'propagate', epath, mode)
else
bool(tk_call('grid', 'propagate', epath))
diff --git a/ext/tk/lib/tkentry.rb b/ext/tk/lib/tkentry.rb
index fc52b9435d..e0589802d2 100644
--- a/ext/tk/lib/tkentry.rb
+++ b/ext/tk/lib/tkentry.rb
@@ -27,9 +27,10 @@ class TkEntry<TkLabel
class ValidateArgs
VARG_KEY = 'disvPSVW'
- VARG_TYPE = 'nxsssssw'
+ VARG_TYPE = 'nxeseesw'
def self.scan_args(arg_str, arg_val)
+ enc = Tk.encoding
arg_cnv = []
arg_str.strip.split(/\s+/).each_with_index{|kwd,idx|
if kwd =~ /^%(.)$/
@@ -39,6 +40,12 @@ class TkEntry<TkLabel
arg_cnv << TkComm::number(arg_val[idx])
when ?s
arg_cnv << TkComm::string(arg_val[idx])
+ when ?e
+ if enc
+ arg_cnv << Tk.fromUTF8(TkComm::string(arg_val[idx]), enc)
+ else
+ arg_cnv << TkComm::string(arg_val[idx])
+ end
when ?w
arg_cnv << TkComm::window(arg_val[idx])
when ?x