9
9
FigureCanvasTkAgg , NavigationToolbar2Tk )
10
10
from matplotlib .figure import Figure
11
11
12
-
13
- # =====================================================#
14
- # ======= Initial Parameters =======#
15
- # =====================================================#
12
+ # Initialization
16
13
17
14
mpl .use ("TkAgg" )
18
15
mpl .style .use ('seaborn-bright' )
21
18
app .resizable (True , False )
22
19
app .title ('GraphMaker' )
23
20
24
- # =====================================================#
25
- # ========= Functions Area =========#
26
- # =====================================================#
21
+ # Global Variables
27
22
h_ = 1
28
23
w_ = 14
29
24
b_ = 1
37
32
file_s = []
38
33
39
34
35
+ # Custom class for functions
36
+ class GraphyFunc :
37
+ pass
38
+
39
+
40
40
# ================| Open menu callback |================#
41
41
def openFile ():
42
42
for widget in infobox .winfo_children ():
@@ -138,9 +138,7 @@ def _quit():
138
138
exit ()
139
139
140
140
141
- # =====================================================#
142
- # ========= Tkinter Functions Area =========#
143
- # =====================================================#
141
+ # Tkinter widget maker
144
142
def widget_func (widget , tabName , text_ , textv_ , he_ , wi_ , command_ , c_ , r_ , py_ , px_ , cs_ , rs_ , stik_ , ** kwargs ):
145
143
if widget == 'btn' :
146
144
ttk .Button (tabName , text = text_ , command = command_ ).grid (column = c_ , row = r_ , pady = py_ , padx = px_ , columnspan = cs_ ,
@@ -150,9 +148,7 @@ def widget_func(widget, tabName, text_, textv_, he_, wi_, command_, c_, r_, py_,
150
148
sticky = stik_ )
151
149
152
150
153
- # ======================================================================================#
154
- # ======================= Menu Area =======================#
155
- # ======================================================================================#
151
+ # Menu Area
156
152
157
153
# -------------------| Menu Bar |-------------------#
158
154
menu_bar = Menu (app )
@@ -170,19 +166,12 @@ def widget_func(widget, tabName, text_, textv_, he_, wi_, command_, c_, r_, py_,
170
166
help_menu .add_command (label = "About" , command = _msgBox )
171
167
menu_bar .add_cascade (label = "Help" , menu = help_menu )
172
168
173
- # ======================================================================================#
174
- # ======================= Multi-Tab ======================#
175
- # ======================================================================================#
176
-
169
+ # ===================| Tab-control |===================#
177
170
tabControl = ttk .Notebook (app )
178
171
tab_1 = ttk .Frame (tabControl )
179
172
tabControl .add (tab_1 , text = ' Graph ' )
180
173
tabControl .pack (expand = 1 , fill = "both" )
181
174
182
- # #######################################################################################
183
- # #################### Tab-1 Area ##########################
184
- # #######################################################################################
185
-
186
175
# =================| Graph-Canvas Frame |=================#
187
176
graph_frame = ttk .LabelFrame (tab_1 , text = ' Graph Canvas ' )
188
177
graph_frame .grid (column = 0 , row = 0 , columnspan = 3 , padx = 8 , pady = 4 )
0 commit comments