DucHaiten commited on
Commit
284f987
1 Parent(s): 5838d8a

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +123 -123
main.py CHANGED
@@ -1,123 +1,123 @@
1
- import tkinter as tk
2
- from tkinter import messagebox
3
- import webbrowser
4
- from image_converter import open_image_converter
5
- from image_filter import open_image_filter
6
- from rotate_flip import open_image_rotate_flip
7
- from image_error_fix import open_image_error_fix
8
- from image_to_tag import open_image_to_tag
9
- from image_to_caption import open_image_to_caption # Import the function from image_to_caption.py
10
- from photo_fantasy import open_photo_fantasy
11
- from shuffle_image import open_image_shuffle # Import the function from shuffle_image.py
12
-
13
- def open_main_menu():
14
- root = tk.Tk()
15
- root.title("IMageDucHaiten")
16
-
17
- def center_window(window):
18
- window.update_idletasks()
19
- width = window.winfo_width()
20
- height = window.winfo_height()
21
- x = (window.winfo_screenwidth() // 2) - (width // 2)
22
- y = (window.winfo_screenheight() // 2) - (height // 2)
23
- window.geometry(f'{width}x{height}+{x}+{y}')
24
-
25
- def open_converter_app():
26
- root.destroy()
27
- open_image_converter()
28
-
29
- def open_image_filter_app():
30
- root.destroy()
31
- open_image_filter()
32
-
33
- def open_rotate_flip_app():
34
- root.destroy()
35
- open_image_rotate_flip()
36
-
37
- def open_image_error_fix_app():
38
- root.destroy()
39
- open_image_error_fix()
40
-
41
- def open_image_to_tag_app():
42
- root.destroy()
43
- open_image_to_tag()
44
-
45
- def open_image_to_caption_app():
46
- root.destroy()
47
- open_image_to_caption()
48
-
49
- def open_photo_fantasy_app():
50
- root.destroy()
51
- open_photo_fantasy()
52
-
53
- def open_shuffle_image_app():
54
- root.destroy()
55
- open_image_shuffle()
56
-
57
- def open_future_app():
58
- messagebox.showinfo("Information", "Other applications are still under development.")
59
-
60
- def exit_app():
61
- root.destroy()
62
-
63
- def open_discord():
64
- webbrowser.open("https://discord.gg/vKEW6jqa49")
65
-
66
- def open_patreon():
67
- webbrowser.open("https://www.patreon.com/duchaitenreal")
68
-
69
- def open_paypal():
70
- webbrowser.open("https://www.paypal.com/paypalme/duchaiten")
71
-
72
- # Setup the interface
73
- top_frame = tk.Frame(root)
74
- top_frame.pack(fill='x', padx=10, pady=10)
75
-
76
- discord_button = tk.Button(top_frame, text="Discord", font=('Helvetica', 12), command=open_discord)
77
- discord_button.pack(side='left')
78
-
79
- patreon_button = tk.Button(top_frame, text="Patreon", font=('Helvetica', 12), command=open_patreon)
80
- patreon_button.pack(side='right')
81
-
82
- paypal_button = tk.Button(top_frame, text="PayPal", font=('Helvetica', 12), command=open_paypal)
83
- paypal_button.pack(side='right')
84
-
85
- title_label = tk.Label(root, text="IMageDucHaiten", font=('Helvetica', 24))
86
- title_label.pack(pady=20)
87
-
88
- converter_button = tk.Button(root, text="Image Converter", font=('Helvetica', 16), command=open_converter_app)
89
- converter_button.pack(pady=20)
90
-
91
- image_filter_button = tk.Button(root, text="Image Filter", font=('Helvetica', 16), command=open_image_filter_app)
92
- image_filter_button.pack(pady=20)
93
-
94
- rotate_flip_button = tk.Button(root, text="Rotate & Flip", font=('Helvetica', 16), command=open_rotate_flip_app)
95
- rotate_flip_button.pack(pady=20)
96
-
97
- error_fix_button = tk.Button(root, text="Image Error Fix", font=('Helvetica', 16), command=open_image_error_fix_app)
98
- error_fix_button.pack(pady=20)
99
-
100
- caption_button = tk.Button(root, text="Image To Tag", font=('Helvetica', 16), command=open_image_to_tag_app)
101
- caption_button.pack(pady=20)
102
-
103
- image_to_caption_button = tk.Button(root, text="Image To Caption", font=('Helvetica', 16), command=open_image_to_caption_app)
104
- image_to_caption_button.pack(pady=20)
105
-
106
- photo_fantasy_button = tk.Button(root, text="Photo Fantasy", font=('Helvetica', 16), command=open_photo_fantasy_app)
107
- photo_fantasy_button.pack(pady=20)
108
-
109
- shuffle_image_button = tk.Button(root, text="Shuffle Image", font=('Helvetica', 16), command=open_shuffle_image_app)
110
- shuffle_image_button.pack(pady=20)
111
-
112
- future_app_button = tk.Button(root, text="Future App Template", font=('Helvetica', 16), command=open_future_app)
113
- future_app_button.pack(pady=20)
114
-
115
- exit_button = tk.Button(root, text="Exit", font=('Helvetica', 16), command=exit_app)
116
- exit_button.pack(pady=20)
117
-
118
- center_window(root)
119
- root.geometry("550x950") # Set the window size larger
120
- root.mainloop()
121
-
122
- if __name__ == "__main__":
123
- open_main_menu()
 
1
+ import tkinter as tk
2
+ from tkinter import messagebox
3
+ import webbrowser
4
+ from image_converter import open_image_converter
5
+ from image_filter import open_image_filter
6
+ from rotate_flip import open_image_rotate_flip
7
+ from image_error_fix import open_image_error_fix
8
+ from image_to_tag import open_image_to_tag
9
+ from image_to_caption import open_image_to_caption # Import the function from image_to_caption.py
10
+ from photo_fantasy import open_photo_fantasy
11
+ from shuffle_image import open_image_shuffle # Import the function from shuffle_image.py
12
+
13
+ def open_main_menu():
14
+ root = tk.Tk()
15
+ root.title("IMageDucHaiten")
16
+
17
+ def center_window(window):
18
+ window.update_idletasks()
19
+ width = window.winfo_width()
20
+ height = window.winfo_height()
21
+ x = (window.winfo_screenwidth() // 2) - (width // 2)
22
+ y = (window.winfo_screenheight() // 2) - (height // 2)
23
+ window.geometry(f'{width}x{height}+{x}+{y}')
24
+
25
+ def open_converter_app():
26
+ root.destroy()
27
+ open_image_converter()
28
+
29
+ def open_image_filter_app():
30
+ root.destroy()
31
+ open_image_filter()
32
+
33
+ def open_rotate_flip_app():
34
+ root.destroy()
35
+ open_image_rotate_flip()
36
+
37
+ def open_image_error_fix_app():
38
+ root.destroy()
39
+ open_image_error_fix()
40
+
41
+ def open_image_to_tag_app():
42
+ root.destroy()
43
+ open_image_to_tag()
44
+
45
+ def open_image_to_caption_app():
46
+ root.destroy()
47
+ open_image_to_caption()
48
+
49
+ def open_photo_fantasy_app():
50
+ root.destroy()
51
+ open_photo_fantasy()
52
+
53
+ def open_shuffle_image_app():
54
+ root.destroy()
55
+ open_image_shuffle()
56
+
57
+ def open_future_app():
58
+ messagebox.showinfo("Information", "Other applications are still under development.")
59
+
60
+ def exit_app():
61
+ root.destroy()
62
+
63
+ def open_discord():
64
+ webbrowser.open("https://discord.gg/vKEW6jqa49")
65
+
66
+ def open_patreon():
67
+ webbrowser.open("https://www.patreon.com/duchaitenreal")
68
+
69
+ def open_paypal():
70
+ webbrowser.open("https://www.paypal.com/paypalme/duchaiten")
71
+
72
+ # Setup the interface
73
+ top_frame = tk.Frame(root)
74
+ top_frame.pack(fill='x', padx=10, pady=10)
75
+
76
+ discord_button = tk.Button(top_frame, text="Discord", font=('Helvetica', 12), command=open_discord)
77
+ discord_button.pack(side='left')
78
+
79
+ patreon_button = tk.Button(top_frame, text="Patreon", font=('Helvetica', 12), command=open_patreon)
80
+ patreon_button.pack(side='right')
81
+
82
+ paypal_button = tk.Button(top_frame, text="PayPal", font=('Helvetica', 12), command=open_paypal)
83
+ paypal_button.pack(side='right')
84
+
85
+ title_label = tk.Label(root, text="IMageDucHaiten", font=('Helvetica', 24))
86
+ title_label.pack(pady=20)
87
+
88
+ converter_button = tk.Button(root, text="Image Converter", font=('Helvetica', 16), command=open_converter_app)
89
+ converter_button.pack(pady=20)
90
+
91
+ image_filter_button = tk.Button(root, text="Image Filter", font=('Helvetica', 16), command=open_image_filter_app)
92
+ image_filter_button.pack(pady=20)
93
+
94
+ rotate_flip_button = tk.Button(root, text="Rotate & Flip", font=('Helvetica', 16), command=open_rotate_flip_app)
95
+ rotate_flip_button.pack(pady=20)
96
+
97
+ error_fix_button = tk.Button(root, text="Image Error Fix", font=('Helvetica', 16), command=open_image_error_fix_app)
98
+ error_fix_button.pack(pady=20)
99
+
100
+ caption_button = tk.Button(root, text="Image To Tag", font=('Helvetica', 16), command=open_image_to_tag_app)
101
+ caption_button.pack(pady=20)
102
+
103
+ image_to_caption_button = tk.Button(root, text="Image To Caption", font=('Helvetica', 16), command=open_image_to_caption_app)
104
+ image_to_caption_button.pack(pady=20)
105
+
106
+ photo_fantasy_button = tk.Button(root, text="Photo Fantasy", font=('Helvetica', 16), command=open_photo_fantasy_app)
107
+ photo_fantasy_button.pack(pady=20)
108
+
109
+ shuffle_image_button = tk.Button(root, text="Shuffle Image", font=('Helvetica', 16), command=open_shuffle_image_app)
110
+ shuffle_image_button.pack(pady=20)
111
+
112
+ future_app_button = tk.Button(root, text="Future App Template", font=('Helvetica', 16), command=open_future_app)
113
+ future_app_button.pack(pady=20)
114
+
115
+ exit_button = tk.Button(root, text="Exit", font=('Helvetica', 16), command=exit_app)
116
+ exit_button.pack(pady=20)
117
+
118
+ center_window(root)
119
+ root.geometry("550x950") # Set the window size larger
120
+ root.mainloop()
121
+
122
+ if __name__ == "__main__":
123
+ open_main_menu()