From: Morton Goldberg Date: 2006-09-01T06:23:19+09:00 Subject: Re: Incorrect return of the TkFont configure instance method when no value Try require 'tk' font = TkFont.new size = font.size #=> 12 (on my system) Regards, Morton On Aug 31, 2006, at 4:09 AM, Lionel MAIAUX wrote: > Hello, > > I already posted this question to the ruby-core mailing-list, but > as I received no answer, I suppose that it was not the right place :-) > > I would like to get the size of a TkFont. > It could be done with something like ... > > require 'tk' > font = TkFont.new... > ... > size = font.configure :size > > ... as it is descibed in the Tk documentation (configure with an > attribute without a value get the value of this attribute). > > Unfortunately, this code returns the font object instead of the > size attribute. > It is confirmed in the configure_core_tk8x method in ext/tk/lib/tk/ > font.rb file (line 1328) : > > def configure_core_tk8x(font, slot, value=None) > ... > self > end > > So my question : is it a bug or there is another (specific ruby) > way to get the font attributes ?