Code: Select all
topmost=True< /code>), alle meine UI-Elemente (Schaltflächen) erscheinen in der oberen linken Ecke des Bildschirms anstatt in meinem Anwendungsfenster falsch. src = "https://i.sstatic.net/noefmapn.png"/>
Minimal reproduzierbares Beispiel
import tkinter as tk
# Create the main window
root = tk.Tk()
root.title("Simple Buttons")
root.attributes('-topmost', True) # Keep the window on top
# Create a frame to hold the buttons
button_frame = tk.Frame(root)
button_frame.pack(padx=10, pady=10)
# Create 8 buttons
button_texts = ["ON/OFF", "LEFT", "DOUBLE", "DRAG", "RIGHT", "SETUP", "MOVE", "EXIT"]
buttons = []
for text in button_texts:
button = tk.Button(button_frame, text=text, width=8, height=2)
button.pack(side=tk.LEFT, padx=2)
buttons.append(button)
# Start the main loop
root.mainloop()
[*]Creating a self-signed certificate
[*]Building with PyInstaller using --uac-uiaccess
[*]Signing the executable
[*]Installing to Program Files
< /ol>
Beim Ausführen der kompilierten ausführbaren Datei werden alle Schaltflächen am oberen linken Bildschirm statt im Fenster angezeigt. frames as containers
[*]Different window configurations
[*]Testing without topmost (works correctly)
[*]Testing with overrideredirect(True) (same issue)
Environment
- Windows 11 24H2
- Python 3.13.3
- PyInstaller 6.13
- tkinter (integriert)