would somebody help to get the height of a Font?
i got the width with measure as seen below but lost in the
woods for the height.
helv12 = tkFont.Font ( family="Helvetica", size=12 )
width = helv12.measure(mytext)
would you please help me
thanks
In the "Tkinter Checkbutton widget" page : I needed how do using this widget. So we must ask "variablename".get() for an answer with an 0 or an 1.
.get() is very great.
Thanks for this work. Good continuation to you.
Something that is obviously useful is to be able to find the attributes of the font that is currently being used by a widget. It is not obvious from the description here how one does that. The answer, discovered by painful experimentation and reading source code, is:
tkFont.Font(font=widget.cget('font')).actual()
It would be helpful to include that as one of your "patterns".
It's good that http://effbot.org/tkinterbook/photoimage.htm has the note about having to keep a reference. I found the page after fathoming out what the problem was myself, and therefore knowing what to Google for. Could the note be extended to explain why the reference Tk must be keeping to the image isn't sufficient?
That assumes that I can figure out why Tk behaves that way :-). If I remember correctly, the library does indeed keep the internal image object around, since it's being displayed, but it explicitly clears the content when Tkinter releases it.
would somebody help to get the height of a Font?
i got the width with measure as seen below but lost in the
woods for the height.
helv12 = tkFont.Font ( family="Helvetica", size=12 )
width = helv12.measure(mytext)
would you please help me
thanks
The Photoimage class discusses about inserting a jpg image. In that, there is one line that shows as
label.image = image # keep a reference!
This does not work. This line should be changed to
label.image = photo # keep a reference!
Kindly check this and change the article if needed. For me, if I place photo in that line, it displayed the image properly.
Thanks for your work.
Is there a way of being able to paste text into an entry widget? Yes, Ctrl + V. I should have tried that first.
In the "Tkinter Checkbutton widget" page : I needed how do using this widget. So we must ask "variablename".get() for an answer with an 0 or an 1.
.get() is very great.
Thanks for this work. Good continuation to you.
Something that is obviously useful is to be able to find the attributes of the font that is currently being used by a widget. It is not obvious from the description here how one does that. The answer, discovered by painful experimentation and reading source code, is:
tkFont.Font(font=widget.cget('font')).actual()
It would be helpful to include that as one of your "patterns".
It's good that http://effbot.org/tkinterbook/photoimage.htm has the note about having to keep a reference. I found the page after fathoming out what the problem was myself, and therefore knowing what to Google for. Could the note be extended to explain why the reference Tk must be keeping to the image isn't sufficient?
That assumes that I can figure out why Tk behaves that way :-). If I remember correctly, the library does indeed keep the internal image object around, since it's being displayed, but it explicitly clears the content when Tkinter releases it.
This is a very good site, but I'd sure like to see this as a pdf file. It would make it a lot easier to search.