Extended maintenance of Ruby 1.9.3 ended on February 23, 2015. Read more
# File tk/lib/tk/font.rb, line 147
def initialize(compound, type)
unless compound.kind_of?(TkFont)
fail ArgumentError, "a TkFont object is expected for the 1st argument"
end
@compound = compound
case type
when 'kanji', 'latin', 'ascii'
@type = type
when :kanji, :latin, :ascii
@type = type.to_s
else
fail ArgumentError, "unknown type '#{type}'"
end
end
# File tk/lib/tk/font.rb, line 180
def [](slot)
@compound.__send__(@type + '_configinfo', slot)
end
# File tk/lib/tk/font.rb, line 183
def []=(slot, value)
@compound.__send__(@type + '_configure', slot, value)
value
end
# File tk/lib/tk/font.rb, line 166
def clone
fail RuntimeError, "cannot clone a descendant font"
end
# File tk/lib/tk/font.rb, line 163
def dup
fail RuntimeError, "cannot dupulicate a descendant font"
end
# File tk/lib/tk/font.rb, line 173
def font
@compound.__send__(@type + '_font_id')
end
# File tk/lib/tk/font.rb, line 188
def method_missing(id, *args)
@compound.__send__(@type + '_' + id.id2name, *args)
end
Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.
If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.
If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.
If you want to help improve the Ruby documentation, please visit Documenting-ruby.org.