• Login or register

discuss.effbot.org

  • Popular
  • Recent
  • An Introduction to Tkinter (effbot.org)
    2 points by effbot 1 year ago
    • 8 comments
  • 1 point by kwabena 1 day ago 0 children

    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

    • link
    • reply
  • 1 point by shank_nasa 1 month ago 0 children

    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.

    • link
    • reply
  • 2 points by Doug7000 3 months ago 0 children

    Is there a way of being able to paste text into an entry widget? Yes, Ctrl + V. I should have tried that first.

    • link
    • reply
  • 1 point by pam547 6 months ago 0 children

    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.

    • link
    • reply
  • 1 point by Marc Culler 8 months ago 0 children

    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".

    • link
    • reply
  • 1 point by Ralph Corderoy 11 months ago 1 child

    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?

    • link
    • reply
    • 1 point by effbot 11 months ago 0 children

      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.

      • link
      • reply
  • 1 point by solarblast 1 year ago 0 children

    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.

    • link
    • reply
  • Widget
  • Recent Comments
  • Leaders
Powered by