2022-04-05 23:55:22 +03:00
|
|
|
import tkinter.messagebox
|
2022-05-22 21:26:31 +03:00
|
|
|
import customtkinter
|
2022-04-05 23:55:22 +03:00
|
|
|
|
2022-11-12 16:01:54 +03:00
|
|
|
customtkinter.set_appearance_mode("dark")
|
2022-04-05 23:55:22 +03:00
|
|
|
|
|
|
|
|
2022-11-12 16:01:54 +03:00
|
|
|
class App(customtkinter.CTk):
|
2022-04-05 23:55:22 +03:00
|
|
|
def __init__(self, *args, **kwargs):
|
|
|
|
super().__init__(*args, **kwargs)
|
|
|
|
|
2022-11-12 16:01:54 +03:00
|
|
|
self.title("test filedialog")
|
2022-04-05 23:55:22 +03:00
|
|
|
|
2022-11-12 16:01:54 +03:00
|
|
|
self.button_1 = customtkinter.CTkButton(master=self, text="askopenfile", command=lambda: print(customtkinter.filedialog.askopenfile()))
|
|
|
|
self.button_1.pack(pady=10)
|
|
|
|
self.button_2 = customtkinter.CTkButton(master=self, text="askopenfiles", command=lambda: print(customtkinter.filedialog.askopenfiles()))
|
|
|
|
self.button_2.pack(pady=10)
|
|
|
|
self.button_3 = customtkinter.CTkButton(master=self, text="askdirectory", command=lambda: print(customtkinter.filedialog.askdirectory()))
|
|
|
|
self.button_3.pack(pady=10)
|
|
|
|
self.button_4 = customtkinter.CTkButton(master=self, text="asksaveasfile", command=lambda: print(customtkinter.filedialog.asksaveasfile()))
|
|
|
|
self.button_4.pack(pady=10)
|
|
|
|
self.button_5 = customtkinter.CTkButton(master=self, text="askopenfilename", command=lambda: print(customtkinter.filedialog.askopenfilename()))
|
|
|
|
self.button_5.pack(pady=10)
|
|
|
|
self.button_6 = customtkinter.CTkButton(master=self, text="askopenfilenames", command=lambda: print(customtkinter.filedialog.askopenfilenames()))
|
|
|
|
self.button_6.pack(pady=10)
|
|
|
|
self.button_7 = customtkinter.CTkButton(master=self, text="asksaveasfilename", command=lambda: print(customtkinter.filedialog.asksaveasfilename()))
|
|
|
|
self.button_7.pack(pady=10)
|
2022-04-05 23:55:22 +03:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
app = App()
|
2022-11-12 16:01:54 +03:00
|
|
|
app.mainloop()
|