Tkinter quesiton: get the width of a frame widget when width is not defined

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • noobuser
    New Member
    • Dec 2007
    • 2

    #1

    Tkinter quesiton: get the width of a frame widget when width is not defined

    Not sure if this question belongs here, so sorry if it doesn't.

    amature programmer here, trying making a media scale widget (like the one in windows media player) for a media player type program (like windows media player). The problem is that i use a dictionary like this to let the scale know where it needs to be at any point in the song:

    def create_mapdic() :
    mapdic={}
    for i in range(0, length_of_song) :
    mapdic [i] = frame_width/length_of_song* i
    return mapdic

    , but being shortsighted making this, i forgot the window needs to be resizeable. Therefore when i place my new widget, i can't define a definite width, making this useless. Is there a way to get the width of the frame holding this, or the window (since the widget will fill the width) at any one time even though the 'width' option is not defined? Or maybe someone has some advice on the widget? Any replies are much appreciated.
Working...