-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtkbauto_tpl.py
93 lines (77 loc) · 2.76 KB
/
tkbauto_tpl.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
'''
code file:
date:
comments:
tkauto generated
'''
import os, sys
from tkinter.font import Font
from ttkbootstrap import *
from ttkbootstrap.constants import *
# from tkinter import Listbox
# from tkinter import filedialog
# from tkinter import messagebox
# from tkinter import simpledialog
# import webbrowser
# from ttkbootstrap.tooltip import ToolTip
# from ttkbootstrap.dialogs import Querybox # get_date, get_font ...
# from functools import partial # action_w_arg = partial(self.proc_btns, n)
# from time import gmtime, strftime
class Application(Frame):
''' main class docstring '''
def __init__(self, parent):
Frame.__init__(self, parent)
self.pack(fill=BOTH, expand=True, padx=4, pady=4)
self.create_widgets()
def create_widgets(self):
''' creates GUI for app '''
# expand widget to fill the grid
# self.columnconfigure(1, weight=1, pad=100)
# self.rowconfigure(1, weight=1, pad=20)
# myfont = Font(family='Lucida Console', weight = 'bold', size = 20)
''' ONLY OPTIONS FOR 'grid' FUNCTIONS:
column row
columnspan rowspan
ipadx and ipady
padx and pady
sticky="nsew"
-------------------------------------------------------- '''
# INSERT TKAUTO OUTPUT BELOW HERE
# def eventHandler(self):
# pass
# def eventHandler(self):
# pass
#
# change working directory to path for this file
p = os.path.realpath(__file__)
os.chdir(os.path.dirname(p))
# THEMES
# 'cosmo', 'flatly', 'litera', 'minty', 'lumen',
# 'sandstone', 'yeti', 'pulse', 'united', 'morph',
# 'journal', 'darkly', 'superhero', 'solar', 'cyborg',
# 'vapor', 'simplex', 'cerculean'
root = Window("template", "superhero", size=(400, 400))
# UNCOMMENT THE FOLLOWING TO SAVE GEOMETRY INFO
# def save_location(e=None):
# ''' executes at WM_DELETE_WINDOW event - see below '''
# with open("winfo", "w") as fout:
# fout.write(root.geometry())
# root.destroy()
# UNCOMMENT THE FOLLOWING TO SAVE GEOMETRY INFO
# if os.path.isfile("winfo"):
# with open("winfo") as f:
# lcoor = f.read()
# root.geometry(lcoor.strip())
# else:
# root.geometry("400x300") # WxH+left+top
# root.protocol("WM_DELETE_WINDOW", save_location) # UNCOMMENT TO SAVE GEOMETRY INFO
Sizegrip(root).place(rely=1.0, relx=1.0, x=0, y=0, anchor='se')
# root.resizable(0, 0) # no resize & removes maximize button
# root.minsize(w, h) # width, height
# root.maxsize(w, h)
# root.overrideredirect(True) # removed window decorations
# root.attributes('-type', 'splash') # don't show in taskbar
# root.iconphoto(False, PhotoImage(file='icon.png'))
# root.attributes("-topmost", True) # Keep on top of other windows
Application(root)
root.mainloop()