-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathapplication.py
57 lines (39 loc) · 1.57 KB
/
application.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import tkinter as tk
from tkinter import ttk
import time
import ui_generics as ui
import ui_imageset as imageset_tab
import ui_video as video_tab
import ui_tagger as tagger_tab
class Application(tk.Tk):
imageset_tab = None
video_tab = None
tag_editor_tab = None
def __init__(self, geometry):
super().__init__()
self.geometry(geometry)
self.title('Fast Batch Image Crop')
self.init_ui()
self.console.write_info('Application init complete.')
def init_ui(self):
self.last_configure_time = time.time()
self.columnconfigure(0, weight=1)
self.rowconfigure(0, weight=1)
# console
self.console = ui.SingleLineConsole(self)
self.console.grid(column=0, row=1, sticky='news')
# tab widget
tabs = ttk.Notebook(self)
tabs.grid(column=0, row=0, sticky='news')
# tabs
self.imageset_tab = imageset_tab.ImagesetTab(self.console)
self.video_tab = video_tab.VideoTab(self.console)
self.tag_editor_tab = tagger_tab.TagEditorTab(self.console)
tabs.add(self.imageset_tab, text='Image Set')
tabs.add(self.video_tab, text='Video')
tabs.add(self.tag_editor_tab, text='Tag Editor')
self.bind('<Configure>', self.window_configure_callback)
self.console.write_info('UI init done.')
def window_configure_callback(self, event):
self.imageset_tab.window_reconfigure(event)
self.tag_editor_tab.window_reconfigure(event)