summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-03-01 14:12:05 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-03-01 14:12:05 +0000
commitffc1a02a81ba317e01462f379a247a7bf81ee92f (patch)
tree8bdc3a25885e17441f366eaa8064479c5312886b
parentaf20a0f90399b62ca524ee9bd967d48eb5becdb1 (diff)
* stable version 1.6.7 released.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@2156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog8
-rw-r--r--ext/tcltklib/tcltklib.c25
-rw-r--r--ext/tk/lib/tk.rb6
-rw-r--r--ext/tk/lib/tkfont.rb16
4 files changed, 51 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 574bb0804a..d24263c66e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,12 +1,12 @@
+Fri Mar 1 23:08:16 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * stable version 1.6.7 released.
+
Fri Mar 1 11:29:10 2002 WATANABE Hirofumi <eban@ruby-lang.org>
* ext/socket/{addinfo.h,getaddrinfo.c} (gai_strerror): add const
qualifier only for uClibc.
-Wed Feb 27 16:31:38 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
-
- * stable version 1.6.7 released.
-
Wed Feb 27 16:30:50 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
* st.c (st_init_table_with_size): num_bins should be prime numbers
diff --git a/ext/tcltklib/tcltklib.c b/ext/tcltklib/tcltklib.c
index b0a4880bfd..081dcb1d2e 100644
--- a/ext/tcltklib/tcltklib.c
+++ b/ext/tcltklib/tcltklib.c
@@ -120,6 +120,30 @@ ip_eval_rescue(failed, einfo)
return Qnil;
}
+/* restart Tk */
+static VALUE
+lib_restart(self)
+ VALUE self;
+{
+ struct tcltkip *ptr; /* tcltkip data struct */
+
+ /* get the data struct */
+ Data_Get_Struct(self, struct tcltkip, ptr);
+
+ /* destroy the root wdiget */
+ ptr->return_value = Tcl_Eval(ptr->ip, "destroy .");
+ /* ignore ERROR */
+ DUMP2("(TCL_Eval result) %d", ptr->return_value);
+
+ /* execute Tk_Init */
+ DUMP1("Tk_Init");
+ if (Tk_Init(ptr->ip) == TCL_ERROR) {
+ rb_raise(rb_eRuntimeError, "%s", ptr->ip->result);
+ }
+
+ return Qnil;
+}
+
static int
#if TCL_MAJOR_VERSION >= 8
ip_ruby(clientData, interp, argc, argv)
@@ -512,6 +536,7 @@ Init_tcltklib()
rb_define_method(ip, "_invoke", ip_invoke, -1);
rb_define_method(ip, "_return_value", ip_retval, 0);
rb_define_method(ip, "mainloop", lib_mainloop, 0);
+ rb_define_method(ip, "restart", lib_restart, 0);
main_thread = rb_thread_current();
#ifdef __MACOS__
diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb
index 66df8de606..be34211e01 100644
--- a/ext/tk/lib/tk.rb
+++ b/ext/tk/lib/tk.rb
@@ -620,6 +620,12 @@ module TkCore
TclTkLib.mainloop
end
+ def restart
+ TkCore::INTERP.restart
+ TkComm::Tk_WINDOWS.clear
+ nil
+ end
+
def event_generate(window, context, keys=nil)
window = window.path if window.kind_of? TkObject
if keys
diff --git a/ext/tk/lib/tkfont.rb b/ext/tk/lib/tkfont.rb
index 42cce80fa3..3f12c2bd20 100644
--- a/ext/tk/lib/tkfont.rb
+++ b/ext/tk/lib/tkfont.rb
@@ -758,6 +758,22 @@ class TkFont
###################################
public
###################################
+ def method_missing(id, *args)
+ name = id.id2name
+ case args.length
+ when 1
+ configure name, args[0]
+ when 0
+ begin
+ configinfo name
+ rescue
+ fail NameError, "undefined local variable or method `#{name}' for #{self.to_s}", error_at
+ end
+ else
+ fail NameError, "undefined method `#{name}' for #{self.to_s}", error_at
+ end
+ end
+
def call_font_configure(path, *args)
args += hash_kv(args.pop.update(@fontslot))
tk_call *args