Skip to content

Commit 283e09a

Browse files
committed
🎨 separate by row, cont. increments
1 parent 83b1b66 commit 283e09a

File tree

1 file changed

+27
-18
lines changed

1 file changed

+27
-18
lines changed

gui/app.py

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -157,13 +157,14 @@ def select_directory():
157157
app.geometry("620x500")
158158
app.title("VueGen GUI")
159159

160+
row_count = 0
160161
##########################################################################################
161162
# Config or directory input
162163
ctk_label_config = customtkinter.CTkLabel(
163164
app,
164165
text="Add path to config file or directory. Select radio button accordingly",
165166
)
166-
ctk_label_config.grid(row=0, column=0, columnspan=2, padx=20, pady=20)
167+
ctk_label_config.grid(row=row_count, column=0, columnspan=2, padx=20, pady=20)
167168
is_dir = tk.BooleanVar(value=True)
168169
callback_radio_config = create_radio_button_callback(is_dir, name="is_dir")
169170
ctk_radio_config_0 = customtkinter.CTkRadioButton(
@@ -173,29 +174,33 @@ def select_directory():
173174
variable=is_dir,
174175
value=False,
175176
)
176-
ctk_radio_config_0.grid(row=1, column=0, padx=20, pady=2)
177+
row_count += 1
178+
##########################################################################################
179+
ctk_radio_config_0.grid(row=row_count, column=0, padx=20, pady=2)
177180
ctk_radio_config_1 = customtkinter.CTkRadioButton(
178181
app,
179182
text="Use dir",
180183
command=callback_radio_config,
181184
variable=is_dir,
182185
value=True,
183186
)
184-
ctk_radio_config_1.grid(row=1, column=1, padx=20, pady=2)
187+
ctk_radio_config_1.grid(row=row_count, column=1, padx=20, pady=2)
185188

186189
config_path = tk.StringVar(value=str(path_to_dat))
187190
config_path_entry = customtkinter.CTkEntry(
188191
app,
189192
width=400,
190193
textvariable=config_path,
191194
)
192-
config_path_entry.grid(row=2, column=0, columnspan=2, padx=5, pady=10)
195+
row_count += 1
196+
##########################################################################################
197+
config_path_entry.grid(row=row_count, column=0, columnspan=2, padx=5, pady=10)
193198
select_directory = create_select_directory(config_path)
194199
select_button = customtkinter.CTkButton(
195200
app, text="Select Directory", command=select_directory
196201
)
197-
select_button.grid(row=2, column=2, columnspan=2, padx=5, pady=10)
198-
202+
select_button.grid(row=row_count, column=2, columnspan=2, padx=5, pady=10)
203+
row_count += 1
199204
##########################################################################################
200205
# Report type dropdown
201206
# - get list of report types from Enum
@@ -204,16 +209,18 @@ def select_directory():
204209
app,
205210
text="Select type of report to generate (using only streamlit for now)",
206211
)
207-
ctk_label_report.grid(row=3, column=0, columnspan=2, padx=20, pady=20)
212+
ctk_label_report.grid(row=row_count, column=0, columnspan=2, padx=20, pady=20)
213+
row_count += 1
214+
##########################################################################################
208215
report_type = tk.StringVar(value=report_types[0])
209216
report_dropdown = customtkinter.CTkOptionMenu(
210217
app,
211218
values=report_types,
212219
variable=report_type,
213220
command=optionmenu_callback,
214221
)
215-
report_dropdown.grid(row=4, column=0, columnspan=2, padx=20, pady=20)
216-
222+
report_dropdown.grid(row=row_count, column=0, columnspan=2, padx=20, pady=20)
223+
row_count += 1
217224
##########################################################################################
218225
# Run Streamlit radio button
219226
run_streamlit = tk.BooleanVar(value=True)
@@ -227,16 +234,16 @@ def select_directory():
227234
variable=run_streamlit,
228235
command=callback_radio_st_run,
229236
)
230-
ctk_radio_st_autorun_1.grid(row=5, column=0, padx=20, pady=20)
237+
ctk_radio_st_autorun_1.grid(row=row_count, column=0, padx=20, pady=20)
231238
ctk_radio_st_autorun_0 = customtkinter.CTkRadioButton(
232239
app,
233240
text="skip starting streamlit",
234241
value=False,
235242
variable=run_streamlit,
236243
command=callback_radio_st_run,
237244
)
238-
ctk_radio_st_autorun_0.grid(row=5, column=1, padx=20, pady=20)
239-
245+
ctk_radio_st_autorun_0.grid(row=row_count, column=1, padx=20, pady=20)
246+
row_count += 1
240247
##########################################################################################
241248
# output directory selection
242249
# ctk_label_outdir = customtkinter.CTkLabel
@@ -245,20 +252,22 @@ def select_directory():
245252
select_output_dir_button = customtkinter.CTkButton(
246253
app, text="Select Output Directory", command=select_output_dir
247254
)
248-
select_output_dir_button.grid(row=6, column=2, columnspan=2, padx=5, pady=10)
255+
select_output_dir_button.grid(row=row_count, column=2, columnspan=2, padx=5, pady=10)
249256

250257
ctk_entry_outpath = customtkinter.CTkEntry(
251258
app,
252259
width=400,
253260
textvariable=output_dir_entry,
254261
)
255-
ctk_entry_outpath.grid(row=6, column=0, columnspan=2, padx=10, pady=10)
262+
ctk_entry_outpath.grid(row=row_count, column=0, columnspan=2, padx=10, pady=10)
263+
row_count += 1
264+
##########################################################################################
256265
ctk_label_appath = customtkinter.CTkLabel(
257266
app,
258267
text=f"App path: {app_path}",
259268
)
260-
ctk_label_appath.grid(row=7, column=0, columnspan=2, padx=20, pady=5)
261-
269+
ctk_label_appath.grid(row=row_count, column=0, columnspan=2, padx=20, pady=5)
270+
row_count += 1
262271
##########################################################################################
263272
# Run VueGen button
264273
run_vuegen = create_run_vuegen(
@@ -269,8 +278,8 @@ def select_directory():
269278
text="Run VueGen",
270279
command=run_vuegen,
271280
)
272-
run_button.grid(row=8, column=0, columnspan=2, padx=20, pady=20)
273-
281+
run_button.grid(row=row_count, column=0, columnspan=2, padx=20, pady=20)
282+
row_count += 1
274283
##########################################################################################
275284
# Run the app in the mainloop
276285
app.mainloop()

0 commit comments

Comments
 (0)