| | |
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:
Solved Threads: 0
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.
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.
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
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.
•
•
Join Date: Oct 2009
Posts: 4
Reputation:
Solved Threads: 0
0
#5 Oct 14th, 2009
Thank you so much. I wasnt using the update() feature- I assumed it was self-updating. Cheers
![]() |
Similar Threads
- python tkinter scroll bar help (Python)
- <iframe src='xx' width=0 height=0> (HTML and CSS)
- Need help with code - grabbing width and height of an element. (JavaScript / DHTML / AJAX)
- CSS Positioning & Width/Height Issue (HTML and CSS)
- Tkinter Window Full Size (Python)
- Center a Tkinter Window (Python)
- Tkinter Window Fixed Size (Python)
Other Threads in the Python Forum
- Previous Thread: Shortest Remaining Time
- Next Thread: Save longest Int in a range (homework) (hailstone sequence)
Views: 406 | Replies: 4
| Thread Tools | Search this Thread |
Tag cloud for Python
approximation array beginner book builtin change cipher clear client code color converter countpasswordentry cturtle curved def dictionary drive dynamic examples excel file float format ftp function gui homework import inches input java library line lines linux list lists loop microcontroller mouse mysqldb mysqlquery newb number numbers output parsing path plugin port prime program programming projects py2exe pygame pymailer pyqt python random recursion recursive redirect remote script scrolledtext search singleton socket sqlite ssh string strings strip subprocess sum syntax table terminal text textarea thread threading time tkinter tlapse tuple tutorial twoup ubuntu unicode urllib urllib2 variable vigenere wikipedia windows wxpython xlwt






