Baby Language Lab Scripts
A collection of data processing tools.
 All Classes Namespaces Files Functions Variables Pages
utils.form.Form Class Reference

This class provides a way to store UI input elements by name so that they can be retrieved later on. More...

Inheritance diagram for utils.form.Form:

Public Member Functions

def __init__
 Constructor. More...
 
def __setattr__
 Called by Python when an instance's data/function member is set to something. More...
 
def __getattr__
 Called by Python when an instance's data/function member is read. More...
 
def get_item_list
 Returns a list of all the controls that have been stored in this Form instance (in no particular order) More...
 

Private Attributes

 _items
 

Detailed Description

This class provides a way to store UI input elements by name so that they can be retrieved later on.

Basically, this is a dictionary, but elements can be added or accessed using the dot notation direclty. This is simply for convenience - so we don't have to pass a bunch of UI inputs around between methods in UI code for doing things like validation/retrieving user input. For example:

1 def create_form():
2  form = Form()
3  form.my_entrybox = gtk.EntryBox(...)
4  form.my_spinner = gtk.SpinButton(...)
5  return form
6 
7 def process_form(form):
8  text_input = form.my_entrybox.get_text()
9  int_input = form.my_spinner.get_int_value()
10  ...

Definition at line 20 of file form.py.

Constructor & Destructor Documentation

def utils.form.Form.__init__ (   self)

Constructor.

Parameters
self

Definition at line 23 of file form.py.

Member Function Documentation

def utils.form.Form.__getattr__ (   self,
  name 
)

Called by Python when an instance's data/function member is read.

Parameters
self
name(string) name of the member being read.
Returns
(anything) value of the member being requested.

Definition at line 42 of file form.py.

def utils.form.Form.__setattr__ (   self,
  name,
  val 
)

Called by Python when an instance's data/function member is set to something.

Parameters
self
name(string) name of the member that is being set on this instance.
val(anything) value to set the member to.

Definition at line 30 of file form.py.

def utils.form.Form.get_item_list (   self)

Returns a list of all the controls that have been stored in this Form instance (in no particular order)

Parameters
self
Returns
(list) list of whatever's been stored in this instance

Definition at line 55 of file form.py.

Member Data Documentation

utils.form.Form._items
private

Definition at line 24 of file form.py.


The documentation for this class was generated from the following file: