summaryrefslogtreecommitdiff
path: root/ext/tk/lib/tkfont.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/tk/lib/tkfont.rb')
-rw-r--r--ext/tk/lib/tkfont.rb18
1 files changed, 17 insertions, 1 deletions
diff --git a/ext/tk/lib/tkfont.rb b/ext/tk/lib/tkfont.rb
index 42cce80fa3..c84d0960ed 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