diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-03-08 07:03:09 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-03-08 07:03:09 +0000 |
| commit | 973dca035ec861c3cbea0faf5e40ccfbcd84bb17 (patch) | |
| tree | d7fbdd608eb0698296838406ea964328994e342c /ext/tk/lib/tkfont.rb | |
| parent | 003d0aecc30a939f0712d9f85e2c150e8ccb78da (diff) | |
| download | ruby-973dca035ec861c3cbea0faf5e40ccfbcd84bb17.tar.gz ruby-973dca035ec861c3cbea0faf5e40ccfbcd84bb17.tar.xz ruby-973dca035ec861c3cbea0faf5e40ccfbcd84bb17.zip | |
* eval.c (cvar_cbase): utility function to find innermost non
singleton cbase.
* eval.c (is_defined): adopt new cvar behavior.
* eval.c (rb_eval): ditto.
* eval.c (assign): ditto.
* class.c (rb_mod_clone): should not call rb_obj_clone(), since
Module does not provide "allocate".
* class.c (rb_singleton_class): should crate new singleton class
if obj is a class or module and attached object is different,
which means metaclass of singleton class is sought.
* time.c (time_s_alloc): now follows allocation framework.
* eval.c (rb_eval): should initialize outer class variables from
methods in singleton class definitions.
* eval.c (assign): ditto.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/lib/tkfont.rb')
| -rw-r--r-- | ext/tk/lib/tkfont.rb | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/ext/tk/lib/tkfont.rb b/ext/tk/lib/tkfont.rb index 42cce80fa..c84d0960e 100644 --- a/ext/tk/lib/tkfont.rb +++ b/ext/tk/lib/tkfont.rb @@ -758,9 +758,25 @@ 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 + tk_call(*args) Tk_FontUseTBL[path] = self self end |
