Code:
#! /usr/bin/python
# This one creates three windows because of the Tk().winfo_screenwidth(),
# Tk().winfo_screenheight() call
from Tkinter import *
def quit(): sys.exit(0)
root = Tk()
root.title("Test screen")
w, h = Tk().winfo_screenwidth(), Tk().winfo_screenheight()
h = h * 0.75
paper = Canvas(root, width = h, height = h, bg = "#000020")
a = h / 10
b = h - a
paper.create_line(a, a, b, b, fill="white")
paper.create_line(a, b, b, a, fill="white")
exitB = Button(text="Exit", width=15, command=quit)
exitB.pack()
paper.pack()
mainloop()
Code:
#! /usr/bin/python
# This one creates only a single window.
from Tkinter import *
def quit(): sys.exit(0)
root = Tk()
root.title("Test screen")
h = 400
paper = Canvas(root, width = h, height = h, bg = "#000020")
a = h / 10
b = h - a
paper.create_line(a, a, b, b, fill="white")
paper.create_line(a, b, b, a, fill="white")
exitB = Button(text="Exit", width=15, command=quit)
exitB.pack()
paper.pack()
mainloop()
Greg
Comment