-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
39 lines (31 loc) · 1.07 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import os
import tkinter as tk
from transform import TransformFrame
from manage import ManageFrame
from image import Image
class Application(tk.Tk):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.width = 1600
self.height = 900
self.geometry(f'{self.width}x{self.height}')
container = tk.Frame(self)
container.pack(fill='both', expand=True, side='top')
container.grid_rowconfigure(0, weight=1)
container.grid_columnconfigure(0, weight=1)
self.images = []
self.frames = {}
for F in (ManageFrame, TransformFrame):
frame = F(container, self)
self.frames[F.__name__] = frame
frame.grid(row=0, column=0, sticky='nsew')
self.switch_frame('ManageFrame')
def switch_frame(self, frame_name):
'''Switch the current frame'''
frame = self.frames[frame_name]
frame.tkraise()
frame.on_switch()
if __name__ == "__main__":
app = Application()
app.wm_title('Image Notebook')
app.mainloop()