diff options
| author | Ian Ward <ian@excess.org> | 2012-09-22 20:31:01 -0400 |
|---|---|---|
| committer | Ian Ward <ian@excess.org> | 2012-09-22 20:31:01 -0400 |
| commit | daefdead5fad770775aa584fc61ea55ef3e8ac89 (patch) | |
| tree | 9af532ce1c5c32542f2fa20a311055c40984975f /docs/manual/wmod.py | |
| parent | 9e73e7756f277a5edd6954043729d03fb47c8ca2 (diff) | |
| download | urwid-daefdead5fad770775aa584fc61ea55ef3e8ac89.tar.gz | |
docs: move some sections from tutorial to widget manual page
--HG--
branch : feature-sphinx
rename : docs/tutorial/wanat.py => docs/manual/wanat.py
rename : docs/tutorial/wanat_multi.py => docs/manual/wanat_multi.py
rename : docs/tutorial/wanat_new.py => docs/manual/wanat_new.py
rename : docs/tutorial/wcur1.py => docs/manual/wcur1.py
rename : docs/tutorial/wcur2.py => docs/manual/wcur2.py
rename : docs/tutorial/wmod.py => docs/manual/wmod.py
rename : docs/tutorial/wsel.py => docs/manual/wsel.py
Diffstat (limited to 'docs/manual/wmod.py')
| -rw-r--r-- | docs/manual/wmod.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/docs/manual/wmod.py b/docs/manual/wmod.py new file mode 100644 index 0000000..a066a49 --- /dev/null +++ b/docs/manual/wmod.py @@ -0,0 +1,15 @@ +import urwid + +class QuestionnaireItem(urwid.WidgetWrap): + def __init__(self): + self.options = [] + unsure = urwid.RadioButton(self.options, u"Unsure") + yes = urwid.RadioButton(self.options, u"Yes") + no = urwid.RadioButton(self.options, u"No") + display_widget = urwid.GridFlow([unsure, yes, no], 15, 3, 1, 'left') + urwid.WidgetWrap.__init__(self, display_widget) + + def get_state(self): + for o in self.options: + if o.get_state() is True: + return o.get_label() |
