Skip to content

Commit 86c5660

Browse files
committed
🎨 format and rename callback factory
1 parent e1150c0 commit 86c5660

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

gui/app.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def optionmenu_callback(choice):
8282
print("optionmenu dropdown clicked:", choice)
8383

8484

85-
def radiobutton_event(value, name="radiobutton"):
85+
def create_radio_button_callback(value, name="radiobutton"):
8686
def radio_button_callback():
8787
print(f"{name} toggled, current value:", value.get())
8888

@@ -103,7 +103,7 @@ def radio_button_callback():
103103
)
104104
ctk_label_config.grid(row=0, column=0, columnspan=2, padx=20, pady=20)
105105
is_dir = tk.BooleanVar(value=True)
106-
callback_radio_config = radiobutton_event(is_dir, name="is_dir")
106+
callback_radio_config = create_radio_button_callback(is_dir, name="is_dir")
107107
ctk_radio_config_0 = customtkinter.CTkRadioButton(
108108
app,
109109
text="Use config",
@@ -147,13 +147,12 @@ def radio_button_callback():
147147
)
148148
report_dropdown.grid(row=4, column=0, columnspan=2, padx=20, pady=20)
149149

150-
_report_type = report_dropdown.get()
151-
print("report_type value:", _report_type)
152-
153150
##########################################################################################
154151
# Run Streamlit radio button
155152
run_streamlit = tk.BooleanVar(value=True)
156-
callback_radio_st_run = radiobutton_event(run_streamlit, name="run_streamlit")
153+
callback_radio_st_run = create_radio_button_callback(
154+
run_streamlit, name="run_streamlit"
155+
)
157156
ctk_radio_st_autorun_1 = customtkinter.CTkRadioButton(
158157
app,
159158
text="autorun streamlit",

0 commit comments

Comments
 (0)