954,525 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Tkinter- Get window width and height. Please help

Hi,

There is a lot of code - so I have attached the entire thing as a zip file.
This is for a function plotter.
Basically, I need to track the changes in the root window size so I can resize the canvas and redraw all the plots.
I'm very new to Tkinter (this is a 1st year uni course for software engineering) and I'm struggling on how to obtain a width/height of the main window. I've set master.geometry("800x600") so I know it starts off at 800 and 600 - but I cant follow these changes.

Please, any help would be greatly appreciated. I think that if I recoded PlotApp and put everything in a frame that fills and expands and then tracked that frame I could do it- but is there an easier way because I think if I had to do it that way there would be a lot of recoding.

Attachments assign2.zip (2.51KB)
marshall31415
Newbie Poster
4 posts since Oct 2009
Reputation Points: 10
Solved Threads: 0
 

I notice you have the binding to the configure event rem'd out. Why?

Wait are you talking about the desktop width and height?

Try this link

http://www-acc.kek.jp/WWW-ACC-exp/KEKB/Control/Activity/Python/TkIntro/tkmanual/winfo.html

gerard4143
Nearly a Posting Maven
2,272 posts since Jan 2008
Reputation Points: 512
Solved Threads: 387
 

I'm trying to determing the width and height of the window with the title "Function Plotter".

I want to expand the canvas and redraw the plots when the window is resized.

marshall31415
Newbie Poster
4 posts since Oct 2009
Reputation Points: 10
Solved Threads: 0
 
vegaseat
DaniWeb's Hypocrite
Moderator
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417
 
Take a look at: http://www.daniweb.com/forums/post1014588.html#post1014588

Thank you so much. I wasnt using the update() feature- I assumed it was self-updating. Cheers

marshall31415
Newbie Poster
4 posts since Oct 2009
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You