Dünner weißer Rahmen um Vollbild-Canvas

Fragen zu Tkinter.
Antworten
Atalanttore
User
Beiträge: 407
Registriert: Freitag 6. August 2010, 17:03

Hallo

Wenn ich mit Tkinter einen schwarzen Canvas mit der Größe des gesamten Bildschirms erstelle, erscheint um das Canvas herum ein dünner weißer Rahmen.

Code: Alles auswählen

from tkinter import *

root = Tk()
root.attributes("-fullscreen", True)
root.focus_set()
root.bind("<Escape>", lambda e: root.quit())

width = root.winfo_screenwidth()
height = root.winfo_screenheight()

window = Canvas(root, width=width, height=height, bg="black")
window.pack()

root.mainloop()
Bekommt man den dünnen weißen Rahmen irgendwie weg?

Gruß
Atalanttore
Benutzeravatar
wuf
User
Beiträge: 1529
Registriert: Sonntag 8. Juni 2003, 09:50

Hi Atalanttore

Hier die Lösung:

Code: Alles auswählen

from tkinter import *

root = Tk()
root.attributes("-fullscreen", True)
root.focus_set()
root.bind("<Escape>", lambda e: root.quit())

width = root.winfo_screenwidth()
height = root.winfo_screenheight()

window = Canvas(root, highlightthickness=0, width=width, height=height,
    bg="black")
window.pack()

root.mainloop()
Gruss wuf ;-)
Take it easy Mates!
Atalanttore
User
Beiträge: 407
Registriert: Freitag 6. August 2010, 17:03

Problem gelöst. Danke.

Gruß
Atalanttore
Antworten