I currently have the following code:
from ipywidgets import Checkbox, Dropdown, interact, widgets
def locate_customer_name(list_of_values: list) -> list:
db_dropdown = widgets.Dropdown(options=['Blue', 'Green', 'Yellow], description='Color:', value=None)
unknown_checkbox = widgets.Checkbox(
value=False, description='Unable to locate Color In list', disabled=False, indent=False
)
@interact(db_dropdown_values=db_dropdown, lost_checkbox=unknown_checkbox)
def _core_func(db_dropdown_values, lost_checkbox):
dropdown_selection = db_dropdown.value
checkbox = unknown_checkbox.value
button = widgets.Button(description='Confirm')
out = widgets.Output()
def _on_button_clicked(dropdown_select, checkbox):
with out:
print(dropdown_select, checkbox)
display(button, out)
button.on_click(_on_button_clicked(dropdown_selection, checkbox))
What I am looking to do is return the values selected in the _on_button_click function (e.g. dropdown_select and checkbox). For now, it seems like I am only able to print those variables out. How would I return them, so I can use them as inputs to another function?