EasySci commited on
Commit
d874818
·
1 Parent(s): 7c0fda5

Update app2.py

Browse files
Files changed (1) hide show
  1. app2.py +4 -4
app2.py CHANGED
@@ -32,12 +32,12 @@ button3 = pn.widgets.Button(icon='settings', icon_size='1.5em', name='Settings',
32
  # Custom RadioButtonGroup widget
33
  select = pn.widgets.RadioButtonGroup(value="⭐", options=["⭐", "🐘"], name='String', align='center')
34
 
35
- # Function to display the selected value
36
  def display_selected_value(event):
37
- print(f"Selected value: {select.value}")
38
 
39
- # Attach the function to the RadioButtonGroup's on_click event
40
- select.on_click(display_selected_value)
41
 
42
  # Create a column layout for the buttons inside the toggleable sidebar
43
  buttons = pn.Column(
 
32
  # Custom RadioButtonGroup widget
33
  select = pn.widgets.RadioButtonGroup(value="⭐", options=["⭐", "🐘"], name='String', align='center')
34
 
35
+ # Define a callback to display the selected value
36
  def display_selected_value(event):
37
+ print(f"Selected value: {event.new}")
38
 
39
+ # Attach the callback to the value_change event of the RadioButtonGroup
40
+ select.param.watch(display_selected_value, 'value')
41
 
42
  # Create a column layout for the buttons inside the toggleable sidebar
43
  buttons = pn.Column(