Tkinter leer in Windows 11. Funktioniert in VSPython

Python-Programme
Anonymous
 Tkinter leer in Windows 11. Funktioniert in VS

Post by Anonymous »

Ich habe ein Projekt in Python 3.7. Es hat in Windows 10 perfekt funktioniert, aber seit dem erzwungenen Windows 11 -Update kann ich es nicht zum Anzeigen bringen. Das Tkinter -GUI -Fenster wird angezeigt, aber leer, keines meiner Tasten oder Seiten Visibile. Wie der Titel sagt, funktioniert es, wenn er durch Visual Studio gelaufen ist. Ich erhalte keine Fehler oder Nachrichten vom Typ. < /P>
Hier ist der Code, den ich für relevant halte. Es sollte mehrere Seiten mit Tasten < /p>
öffnen#! /usr/bin/python3
import sys
import os
from tkinter import *
from tkinter.ttk import *
from tkinter import simpledialog

style = Style()
style.configure('W.TButton', font =('calibri', 45, 'bold'), foreground = 'black',background='orange')
style.configure('Z.TButton', font =('calibri', 30, 'bold'), foreground = 'black',background='orange')
style.configure('S.TButton', font =('calibri', 45, 'bold'), foreground = 'white',background='red')
style.theme_settings("default",{"TNotebook.Tab": {"configure":{"padding": [30, 30]}}})
style.configure('Tnotebook.Tab', font =('calibri', 50, 'bold'))
root.geometry("1200x600+40+100")
root.title("Program name here")
nbook = Notebook(root)
page1 = Frame(nbook, style='')
nbook.pack(fill=BOTH, expand=1)
# handles closing
root.protocol("WM_DELETE_WINDOW", on_closing)
root.mainloop()
< /code>
Wie es aussehen sollte, < /p>
Ich habe versucht, die Stellen von Root zu ändern. Ich weiß nicht, was ich sonst noch ausprobieren soll, vor allem, weil es unter Windows 10 funktioniert hat und wenn es aus Visual Studio ausgeführt wird.

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post