EasySci commited on
Commit
8827ec0
·
1 Parent(s): 8d33d20

Update app2.py

Browse files
Files changed (1) hide show
  1. app2.py +7 -2
app2.py CHANGED
@@ -30,11 +30,16 @@ button2 = pn.widgets.Button(icon='file-analytics', name='My papers', icon_size='
30
  button3 = pn.widgets.Button(icon='settings', icon_size='1.5em', name='Settings', button_type='primary', button_style='outline', width=140)
31
 
32
  # Custom RadioButtonGroup widget
33
- select = pn.widgets.RadioButtonGroup(value="Scientic", options=["General", "Scientic"], name='String', align='center', button_type='primary')
34
- select2 = pn.widgets.RadioButtonGroup(value="Normal", options=["Bionic", "Normal"], name='String', align='center', button_type='primary')
35
 
36
  # Define a callback to display the selected value
37
  def display_selected_value(event):
 
 
 
 
 
38
  print(f"Selected value: {event.new}", flush = True)
39
 
40
  # Attach the callback to the value_change event of the RadioButtonGroup
 
30
  button3 = pn.widgets.Button(icon='settings', icon_size='1.5em', name='Settings', button_type='primary', button_style='outline', width=140)
31
 
32
  # Custom RadioButtonGroup widget
33
+ select = pn.widgets.RadioButtonGroup(value="Scientic", options=["General", "Scientic"], name='String', align='center',button_type = 'default')
34
+ select2 = pn.widgets.RadioButtonGroup(value="Normal", options=["Bionic", "Normal"], name='String', align='center',button_type = 'default')
35
 
36
  # Define a callback to display the selected value
37
  def display_selected_value(event):
38
+ for option in select.options:
39
+ if option == event.new:
40
+ option.button_type = 'primary'
41
+ else:
42
+ option.button_type = 'default'
43
  print(f"Selected value: {event.new}", flush = True)
44
 
45
  # Attach the callback to the value_change event of the RadioButtonGroup