Python Forum
[Tkinter] canvas size
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] canvas size
#1
Hi,
I have an app with a large canvas, showing images.
The canvas is configured:
tifCanvas = Canvas(root, width = 1200, height = 950, relief=RAISED,bg='lightgreen')
tifCanvas.pack(side=LEFT,fill=BOTH,padx=10,pady=10)
I can check this when the app starts by printing:
print('w:',tifCanvas.winfo_reqwidth(),'h:',tifCanvas.winfo_reqheight())
It says : 1204 x 954. OK, so far, so good.
But my monitor is much bigger (1920 x 1200)
When I click (top right) to maximize my app window to fit the monitor,
the canvas clearly gets bigger (fill BOTH), the image stays the same, and when i click a secret button
to print the canvas size at that moment, it slill says: 1204 x 954.
If i can get the correct canvas size at any moment, i could resize my image to be bigger.
But how to find it?
thx,
Paul
It is more important to do the right thing, than to do the thing right.(P.Drucker)
Better is the enemy of good. (Montesquieu) = French version for 'kiss'.
Reply


Messages In This Thread
canvas size - by DPaul - May-04-2022, 07:23 AM
RE: canvas size - by menator01 - May-04-2022, 09:50 AM
RE: canvas size - by DPaul - May-04-2022, 12:34 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tkinter] Trying to change font size w/o changing button size python63 3 10,008 Aug-05-2020, 01:04 AM
Last Post: Larz60+
  [Tkinter] Resizing image inside Canvas (with Canvas' resize) Gupi 2 25,213 Jun-04-2019, 05:05 AM
Last Post: Gupi
  PyGtk3 why is Locale Folder Size Half of Module Size ? harun2525 1 3,681 Mar-09-2017, 03:46 AM
Last Post: Analyser

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020