This widget usually allows the user to say "do this now !".
They are typically used in toolbars, application windows, and to accept
or dismiss data entered into a dialog box.
For more information on the button widget please refer to:
http://www.pythonware.com/library/tkinter/introduction/button.htm
- Options:
The options used to describe the Button widget can be
found at: http://www.pythonware.com/library/tkinter/introduction/x1366-options.htm
- Example:
Here is an example of an inputFormDescr dictionary describing a Button:
The Checkbutton widget is used to implement on-off selections.
Checkbuttons
can contain text or images, and you can bind a Python function or method
to each button. When the button is pressed, Tkinter automatically calls
that function or method.
For more information on the Checkbutton widget please refer to:
http://www.pythonware.com/library/tkinter/introduction/checkbutton.htm
- Options:
The options used to describe the Checkbutton widget can be
found at: http://www.pythonware.com/library/tkinter/introduction/x3565-options.htm
- Example:
Here is an example of an inputFormDescr dictionary describing a
Checkbutton. An IntVar will be by default associated with the
checkbutton if the widget configuration dictionary doesn't contain the
variable option.
The Radiobutton is a standard Tkinter widget used to implement
one-of-many selections.
Each group of Radiobutton widgets should be associated with single
variable. Each button then represents a single value for that
variable.
We also provide support to build group of radiobuttons please also refer
to
group of Tkinter widgets below.
For more information on the Radiobutton widget please refer to:
http://www.pythonware.com/library/tkinter/introduction/radiobutton.htm
- Options:
The options used to describe a Radiobutton widget can be found
at:
http://www.pythonware.com/library/tkinter/introduction/x6637-options.htm
- Example:
Here is an example of an inputFormDescr dictionary describing two
Radiobuttons. A StringVar will be by default associated with the
radiobutton if the widget configuration dictionary doesn't contain the
variable option.
|
|
>>>from ViewerFramework.gui import InputFormDescr
>>>import Tkinter
>>>idf = InputFormDescr(title = 'Radiobuttons')
>>>idf.append({'widgetType':Tkinter.Radiobutton,
'name':'radiobutton1',
'defaultValue':'Radiobutton1',
'wcfg':{'text':'Radiobutton1',
'variable':radiobuttonVar,
'value':'Radiobutton1'},
'gridcfg':{'sticky':'w'}})
>>>idf.append({'widgetType':Tkinter.Radiobutton,
'name':'radiobutton2',
'defaultValue':'Radiobutton1',
'wcfg':{'text':'Radiobutton2',
'variable':radiobuttonVar,
'value':'Radiobutton2'},
'gridcfg':{'sticky':'w'}})
>>>val = self.vf.getUserInput(idf)
>>>print val
|
The Entry widget is a standard Tkinter widget used to enter or display
a single line of text.
To build an Entry with a label use the
Pmw.EntryField widget.
For more information on the Entry widget please refer to:
http://www.pythonware.com/library/tkinter/introduction/entry.htm
- Options:
The options used to describe the Entry widget can be
found at: http://www.pythonware.com/library/tkinter/introduction/x4069-options.htm
- Example:
Here is an example of an inputFormDescr dictionary describing an
Entry. An StringVar will be by default associated with the
checkbutton if the widget configuration dictionary doesn't contain the
textvariable option.
The Text widget provides formatted text display. It allows you to display
and edit text with various styles and attributes. The widget also
supports embedded images and windows.For more information on the Text
widget please refer to:
http://www.pythonware.com/library/tkinter/introduction/text.htm
If you need a Text widget with scrollbars and a label you can use the
Pmw.ScrolledText Widget .
- Options:
The options used to describe the Text widget can be
found at: http://www.pythonware.com/library/tkinter/introduction/x8518-options.htm
- Example:
Here is an example of an inputFormDescr dictionary describing a
Text widget.
The Label widget is a standard Tkinter widget used to display a text or
image on the screen.
For more information on the Label widget please refer to:
http://www.pythonware.com/library/tkinter/introduction/label.htm
- Options:
The options used to describe the Text widget can be
found at: http://www.pythonware.com/library/tkinter/introduction/x4880-options.htm
- Example:
Here is an example of an inputFormDescr dictionary describing a
Label widget.
Listboxes are used to select from a group of textual items.
Depending on how the listbox is configured, the user can select one or
many items from that list.
- Options:
The options describing a listbox widget can be found at:
http://www.pythonware.com/library/tkinter/introduction/x5297-options.htm
The Listbox widget is not supported by the InputForm because you cannot pass
its items as an argument to its constructor.
However you can use the customizedWidgets.ListChooser or
the Pmw.ScrolledListBox widget.
The Menu widget is used to implement toplevel, pulldown, and popup menus.
For more information on the Menu widget please refer to :
http://www.pythonware.com/library/tkinter/introduction/menu.htm
- Options:
The options describing the Menu widget can be found at :
http://www.pythonware.com/library/tkinter/introduction/x5740-options.htm
- Example:
Sorry no example available for this widget :(
The message widget is used to display multiple lines of text.
It's very similar to a plain Label, but can adjust its width to maintain
a given aspect ratio.
For more information on the Message widget please refer to:
http://www.pythonware.com/library/tkinter/introduction/message.htm
- Options:
The options describing the Message widget can be found at :
http://www.pythonware.com/library/tkinter/introduction/x5937-options.htm
- Example:
Here is an example of an inputFormDescr dictionary describing a Message
widget.
For more information on the Scale widget please refer to :
http://www.pythonware.com/library/tkinter/introduction/scale.htm
- Options:
The options describing the Scale widget can be found at:
http://www.pythonware.com/library/tkinter/introduction/x6943-options.htm
- Example:
Here is an example of an inputFormDescr dictionary describing a
Scale widget.
This widget is used to implement scrolled listboxes, canvases, and
textfields. All these widgets are available as
Python Mega Widgets
or also as
the customized Widgets.
For more information on the scrollbar widget please refer to:
http://www.pythonware.com/library/tkinter/introduction/scrollbar.htm
- Options:
The options describing the scrollbar widget can be found at
http://www.pythonware.com/library/tkinter/introduction/x7270-options.htm
The Canvas widget provides structured graphics facilities for Tkinter.
This is a highly versatile widget which are used to draw graphs and plots,
create graphics editors, and implement various kinds of custom widgets.
Sorry you cannot yet use the Canvas widget as a container
using InputForm :( But you can create a
customizedWidgets using a Canvas widget.
- Options:
The options describing a Canvas widget can be found at:
http://www.pythonware.com/library/tkinter/introduction/x2222-options.htm
We created this widgetType to build groups of widget of the same kind more easily.
It is generally used to build a group of radiobuttons.
The widgets belonging to the same group only differs by their text or label.
- Options:
The inputFormDescr dictionary used to create a group of widget of the same type
should contain the following couples (option:value), on top of the ones listed in
the chapter presenting
the
inputFormDescr class .
| direction |
specifies the direction to organize the widgets of the group if
different from the defaultDirection. |
| groupedBy |
When you want to subdivide your group, this flag specifies how many widget
you want per subgroup. It adds another control on the way the widgets are
organized in the form. |
| listtext |
List of the option text of your tkinter widget if it has one..
|
- Example:
Here is an example of an inputFormDescr dictionary describing a group of
radiobuttons.
|
|
>>>from ViewerFramework.gui import InputFormDescr
>>>import Tkinter
>>># Define the Tkinter variable shared by all the radiobutton.
>>>icecream = Tkinter.StringVar()
>>>idf = InputFormDescr(title="Group of Radiobutton")
>>>flavors = ['rasberry', 'strawberry','chocolate', 'vanilla',
'pecan','peach','apricot','pear']
>>># Added some space so all the widgets are aligned.
>>>idf.append({'name': 'groupOfRadiobuttons',
'widgetType': Tkinter.Radiobutton,
'listtext': flavors,
'groupedBy':3,
'defaultValue':'chocolate',
'wcfg':{'variable':'icecream'},
'gridcfg':{'sticky':Tkinter.W}})
>>>val = self.vf.getUserInput(idf)
>>>print val
|