Tkinter- Get window width and height. Please help

Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Oct 2009
Posts: 4
Reputation: marshall31415 is an unknown quantity at this point 
Solved Threads: 0
marshall31415 marshall31415 is offline Offline
Newbie Poster

Tkinter- Get window width and height. Please help

 
0
  #1
Oct 14th, 2009
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.
Last edited by marshall31415; Oct 14th, 2009 at 10:32 am.
Attached Files
File Type: zip assign2.zip (2.5 KB, 6 views)
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 431
Reputation: gerard4143 is on a distinguished road 
Solved Threads: 52
gerard4143's Avatar
gerard4143 gerard4143 is offline Offline
Posting Pro in Training
 
0
  #2
Oct 14th, 2009
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/KE...ual/winfo.html
Last edited by gerard4143; Oct 14th, 2009 at 10:50 am.
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 4
Reputation: marshall31415 is an unknown quantity at this point 
Solved Threads: 0
marshall31415 marshall31415 is offline Offline
Newbie Poster
 
0
  #3
Oct 14th, 2009
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.
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 4,145
Reputation: vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice 
Solved Threads: 949
Moderator
vegaseat's Avatar
vegaseat vegaseat is offline Offline
DaniWeb's Hypocrite
 
1
  #4
Oct 14th, 2009
May 'the Google' be with you!
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 4
Reputation: marshall31415 is an unknown quantity at this point 
Solved Threads: 0
marshall31415 marshall31415 is offline Offline
Newbie Poster
 
0
  #5
Oct 14th, 2009
Originally Posted by vegaseat View Post
Take a look at:
http://www.daniweb.com/forums/post10...ml#post1014588
Thank you so much. I wasnt using the update() feature- I assumed it was self-updating. Cheers
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:




Views: 406 | Replies: 4
Thread Tools Search this Thread



Tag cloud for Python
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC