ruby-changes:4889
From: ko1@a...
Date: Mon, 12 May 2008 12:59:40 +0900 (JST)
Subject: [ruby-changes:4889] nagai - Ruby:r16382 (ruby_1_8): * ext/tk/lib/tk/wm.rb: Wm#overrideredirect overwrites arguemnt to
nagai 2008-05-12 12:59:23 +0900 (Mon, 12 May 2008)
New Revision: 16382
Modified files:
branches/ruby_1_8/ext/tk/lib/tk/wm.rb
branches/ruby_1_8/ext/tk/lib/tk.rb
branches/ruby_1_8/ext/tk/sample/ttk_wrapper.rb
Log:
* ext/tk/lib/tk/wm.rb: Wm#overrideredirect overwrites arguemnt to
an invalid value.
* ext/tk/sample/ttk_wrapper.rb: support "if __FILE__ == $0" idiom.
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/ext/tk/lib/tk/wm.rb?r1=16382&r2=16381&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/ext/tk/lib/tk.rb?r1=16382&r2=16381&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/ext/tk/sample/ttk_wrapper.rb?r1=16382&r2=16381&diff_format=u
Index: ruby_1_8/ext/tk/sample/ttk_wrapper.rb
===================================================================
--- ruby_1_8/ext/tk/sample/ttk_wrapper.rb (revision 16381)
+++ ruby_1_8/ext/tk/sample/ttk_wrapper.rb (revision 16382)
@@ -4,7 +4,7 @@
#
# by Hidetoshi NAGAI (nagai@a...)
#
-version = '0.1.2'
+version = '0.1.3'
#
##########################################################################
# parse commandline arguments
@@ -120,10 +120,32 @@
##########################################################################
+# replace $0 and $RPAGRAM_NAME
+##########################################################################
+# When the expand_path of the target script is long, ruby sometimes
+# fails to set the path to $0 (the path string is trimmed).
+# The following replaces $0 and $PROGNAME to avoid such trouble.
+progname_obj = $0.dup
+$program_name = progname_obj
+
+alias $REAL_PROGRAM_NAME $0
+alias $PROGRAM_NAME $program_name
+alias $0 $program_name
+
+trace_var(:$program_name){|val|
+ unless progname_obj.object_id == val.object_id
+ progname_obj.replace(val.to_s)
+ $program_name = progname_obj
+ end
+}
+
+
+##########################################################################
# load script
##########################################################################
if (path = ARGV.shift) && (script = File.expand_path(path))
print "load script \"#{script}\"\n" if OPTS[:verbose]
+ $0 = script
load(script)
else
print "Error: no script is given.\n"
Index: ruby_1_8/ext/tk/lib/tk.rb
===================================================================
--- ruby_1_8/ext/tk/lib/tk.rb (revision 16381)
+++ ruby_1_8/ext/tk/lib/tk.rb (revision 16382)
@@ -5359,7 +5359,7 @@
#Tk.freeze
module Tk
- RELEASE_DATE = '2008-05-11'.freeze
+ RELEASE_DATE = '2008-05-12'.freeze
autoload :AUTO_PATH, 'tk/variable'
autoload :TCL_PACKAGE_PATH, 'tk/variable'
Index: ruby_1_8/ext/tk/lib/tk/wm.rb
===================================================================
--- ruby_1_8/ext/tk/lib/tk/wm.rb (revision 16381)
+++ ruby_1_8/ext/tk/lib/tk/wm.rb (revision 16382)
@@ -362,7 +362,7 @@
end
end
def overrideredirect(mode=TkComm::None)
- Wm.overrideredirect(self, mode=TkComm::None)
+ Wm.overrideredirect(self, mode)
end
alias wm_overrideredirect overrideredirect
TOPLEVEL_METHODCALL_OPTKEYS['overrideredirect'] = 'overrideredirect'
--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/