8. RadioButton

Last page update: November 23, 2011

Note

RadioButton

8.1. definition

GnrDomSrc_dojo_11.radiobutton(label=None, **kwargs)

Radiobuttons are used when you want to let the user select one - and just one - option from a set of choices (if more options are to be allowed at the same time you should use checkboxes instead)

Parameters:
  • label – the radiobutton label
  • kwargs
    • group: allow to create a radiobutton group. To create a group, give the same string to the group attribute of many radiobuttons. You can obviously create more than a group giving a different string to the group attribute (for more information, check the group example)

8.2. examples

8.2.1. group example

Let’s see a simple example:

class GnrCustomWebPage(object):
    def main(self,root,**kwargs):
        fb=root.contentPane(title='Buttons',datapath='test1').formbuilder(cols=3,border_spacing='10px')

        fb.radiobutton(value='^.radio.jazz',group='music',label='Jazz')
        fb.radiobutton(value='^.radio.rock',group='music',label='Rock')
        fb.radiobutton(value='^.radio.blues',group='music',label='Blues')

        fb.div('Sex')
        fb.radiobutton(value='^.sex.male',group='my_group',label='M')
        fb.radiobutton(value='^.sex.female',group='my_group',label='F')

Table Of Contents

Previous topic

7. NumberSpinner

Next topic

9. SimpleTextarea

This Page