Hi,
is it possible to have custom tooltips on a list of checkboxes?
The example below will produce a list of checkboxes where the same text is used for both checkbox labels and tooltips.
import ipywidgets as widgets
data = {"key_1":"value_1", "key_2":"value_2", "key_3":"value_3"}
names = []
checkbox_objects = []
for key in data:
checkbox_objects.append(widgets.Checkbox(value=False, description=key))
names.append(key)
arg_dict = {names[i]: checkbox for i, checkbox in enumerate(checkbox_objects)}
ui = widgets.VBox(children=checkbox_objects)
selected_data = []
selected_label = []
def select_data(**kwargs):
selected_data.clear()
selected_label = []
for key in kwargs:
if kwargs[key] is True:
selected_data.append(key)
selected_label.append(data[key])
print(selected_data, selected_label)
out = widgets.interactive_output(select_data, arg_dict)
display(ui, out)
# How to change the tooltip text?
My aim is to have the checkboxes tooltips render the value_#
from the given dict. is that possible?