Files
shared_libs/mainwindow.py
2025-07-25 23:42:43 +02:00

40 lines
1.2 KiB
Python

#!/usr/bin/python3
import tkinter as tk
from tkinter import ttk
from custom_file_dialog import CustomFileDialog
class GlotzMol(tk.Tk):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.geometry('800x400')
ttk.Label(text="Custodialog-teschdfeschda").grid(row=0, column=0)
self.columnconfigure(1, weight=1)
self.iso_path_entry = ttk.Entry(self)
self.iso_path_entry.grid(
row=1, column=0, columnspan=2, padx=15, pady=5, sticky="ew")
ttk.Button(self, text="Öffnen", command=self.customtest).grid(
row=2, column=0, padx=5, pady=5)
def customtest(self):
dialog = CustomFileDialog(self, initial_dir="/home/punix/Downloads",
filetypes=[("ISO files", "*.iso")])
path = dialog.get_selected_file()
if path:
self.iso_path_entry.delete(0, tk.END)
self.iso_path_entry.insert(0, path)
if __name__ == "__main__":
root = GlotzMol()
theme_path = '/usr/share/TK-Themes'
style = ttk.Style(root)
root.tk.call('source', f"{theme_path}/water.tcl")
try:
root.tk.call('set_theme', 'dark')
except tk.TclError:
pass
root.mainloop()