summaryrefslogtreecommitdiffstats
path: root/ext/tk/lib
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-07-28 09:15:37 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-07-28 09:15:37 +0000
commit35f3e20164b3a0b277ec9e95d3761e0af7cc84c0 (patch)
treef62d57e4fd368ad5aa9afc2e4bfc4e34b89f2b27 /ext/tk/lib
parent28fc2f242c32ad581384848645283310a686faf4 (diff)
downloadruby-35f3e20164b3a0b277ec9e95d3761e0af7cc84c0.tar.gz
ruby-35f3e20164b3a0b277ec9e95d3761e0af7cc84c0.tar.xz
ruby-35f3e20164b3a0b277ec9e95d3761e0af7cc84c0.zip
* ext/tcltklib/stubs.c: When --enable-tcltk-stubs, the initialize
routine creates a Tcl/Tk interpreter and deletes it. However, init cost of Tk's MainWindow is not so small. And that makes it impossible to use libraries written with Tcl functions only on an environment without a graphical display. This changes support delaying initalization of Tk_Stubs until the script needs Tk. * ext/tcltklib/stubs.h: New file. Define prototypes and return codes of functions on stubs.c. * ext/tcltklib/tcltklib.c: Support delaying initalization of Tk_Stubs until the script needs Tk. * ext/tcltklib/tcltklib.c: Show friendly error messages for errors on initialization. * ext/tcltklib/tcltklib.c: Avoid SEGV on ip_finalize() when ruby is exiting and $DEBUG is true. (Not fix. If you know the reason of why, please fix it.) * ext/tk/tkutil.c (ary2list, ary2list2): bug fix on handling of encoding. * ext/tk/lib/multi-tk.rb: MultiTkIp#eval_string and bg_eval_string don't work propery. * ext/tk/lib/tk.rb: Forget extending Tk::Encoding module to Tk. * ext/tk/lib/tk/variable.rb: TkVarAccess fails to initialize the object for an element of a Tcl's array variable. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@8861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/lib')
-rw-r--r--ext/tk/lib/multi-tk.rb4
-rw-r--r--ext/tk/lib/tk.rb4
-rw-r--r--ext/tk/lib/tk/variable.rb11
3 files changed, 15 insertions, 4 deletions
diff --git a/ext/tk/lib/multi-tk.rb b/ext/tk/lib/multi-tk.rb
index 8ef3aa62b..c82fa8f4e 100644
--- a/ext/tk/lib/multi-tk.rb
+++ b/ext/tk/lib/multi-tk.rb
@@ -1579,7 +1579,7 @@ class MultiTkIp
proc{|safe|
$SAFE=safe if $SAFE < safe
Kernel.eval(cmd, *eval_args)
- }, safe_level)
+ })
end
alias eval_str eval_string
@@ -1593,7 +1593,7 @@ class MultiTkIp
proc{|safe|
$SAFE=safe if $SAFE < safe
Kernel.eval(cmd, *eval_args)
- }, safe_level)
+ })
}
end
alias background_eval_string bg_eval_string
diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb
index 174d34cea..37f311c6f 100644
--- a/ext/tk/lib/tk.rb
+++ b/ext/tk/lib/tk.rb
@@ -2325,6 +2325,8 @@ else
end
alias encoding_convert_to encoding_convertto
end
+
+ extend Encoding
end
end
@@ -4199,7 +4201,7 @@ end
#Tk.freeze
module Tk
- RELEASE_DATE = '2005-07-25'.freeze
+ RELEASE_DATE = '2005-07-28'.freeze
autoload :AUTO_PATH, 'tk/variable'
autoload :TCL_PACKAGE_PATH, 'tk/variable'
diff --git a/ext/tk/lib/tk/variable.rb b/ext/tk/lib/tk/variable.rb
index 4cf2eae8e..33cf603a9 100644
--- a/ext/tk/lib/tk/variable.rb
+++ b/ext/tk/lib/tk/variable.rb
@@ -1531,7 +1531,16 @@ class TkVarAccess<TkVariable
@element_type = Hash.new{|k,v| var.default_value_type }
# teach Tk-ip that @id is global var
- INTERP._invoke_without_enc('global', @id)
+ begin
+ INTERP._invoke_without_enc('global', @id)
+ rescue => e
+ if @id =~ /^(.+)\([^()]+\)$/
+ # is an element --> varname == $1
+ INTERP._invoke_without_enc('global', $1)
+ else
+ fail e
+ end
+ end
if val
if val.kind_of?(Hash)