how to maximize a Tkinter Window in python TK???

M

Matimus

hello @ all,

subj?

example:
import Tkinter as tk

rt = tk.Tk()
rt.state("zoomed")
rt.overrideredirect(True)
can = tk.Canvas(rt, bg="black",borderwidth=0,highlightthickness=0)
can.pack(expand=True, fill=tk.BOTH)

def draw_rect(e):
can.create_rectangle(e.x,e.y,e.x+100,e.y+100, fill='white',
outline='white')
can.bind("<Button-1>",draw_rect)
rt.bind("<Escape>",lambda e:rt.destroy())

rt.mainloop()

-Matt
 
J

Jose Ignacio Gisbert

If you want to start with your main window maximized, you can do:

root = Tk()
root.state("zoomed")

Regards,
Naxo



-----Mensaje original-----
De: [email protected]
[mailto:p[email protected]] En
nombre de Matimus
Enviado el: jueves, 13 de diciembre de 2007 2:18
Para: (e-mail address removed)
Asunto: *SPAM*: 04.0/4.0 - Re: how to maximize a Tkinter Window in python
TK???

hello @ all,

subj?

example:
import Tkinter as tk

rt = tk.Tk()
rt.state("zoomed")
rt.overrideredirect(True)
can = tk.Canvas(rt, bg="black",borderwidth=0,highlightthickness=0)
can.pack(expand=True, fill=tk.BOTH)

def draw_rect(e):
can.create_rectangle(e.x,e.y,e.x+100,e.y+100, fill='white',
outline='white')
can.bind("<Button-1>",draw_rect)
rt.bind("<Escape>",lambda e:rt.destroy())

rt.mainloop()

-Matt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top