Add radio buttons to ini files (radio = radio_group_name)
This commit is contained in:
@ -11,6 +11,7 @@ config = None
|
||||
verbose = False
|
||||
depth_list = []
|
||||
line_list = []
|
||||
Radio_Groups = {}
|
||||
|
||||
def read_config_file(config_filename):
|
||||
import ConfigParser
|
||||
@ -134,10 +135,21 @@ def main(config_filename):
|
||||
if 'desc' in config.options(txt):
|
||||
cb_text += config.get(txt, 'desc').strip("\"")
|
||||
cb_text += ")"
|
||||
cb = urwid.AttrWrap(urwid.CheckBox(cb_text,
|
||||
state=state,
|
||||
on_state_change=checkbox_change,
|
||||
user_data=txt), 'buttn', 'buttnf')
|
||||
if 'radio' in config.options(txt):
|
||||
radio = config.get(txt, 'radio').strip("\"")
|
||||
if radio not in Radio_Groups:
|
||||
Radio_Groups[radio] = []
|
||||
cb = urwid.AttrWrap(urwid.RadioButton(
|
||||
Radio_Groups[radio],
|
||||
cb_text,
|
||||
state=state,
|
||||
on_state_change=checkbox_change,
|
||||
user_data=txt), 'buttn', 'buttnf')
|
||||
else:
|
||||
cb = urwid.AttrWrap(urwid.CheckBox(cb_text,
|
||||
state=state,
|
||||
on_state_change=checkbox_change,
|
||||
user_data=txt), 'buttn', 'buttnf')
|
||||
cb_list.append(cb)
|
||||
lb_list.append(cb)
|
||||
|
||||
|
Reference in New Issue
Block a user