Once a form is created, all the widgets that are added with a name
are added to that form.
18: self.value = gui.Form()
19:
20: t = gui.Table()
21:
22: t.tr()
23: t.td(gui.Label("Size"),align=0,colspan=2)
24:
25: tt = gui.Table()
26: tt.tr()
27: tt.td(gui.Label("Width: "),align=1)
28: tt.td(gui.Input(name="width",value=256,size=4))
29: tt.tr()
30: tt.td(gui.Label("Height: "),align=1)
31: tt.td(gui.Input(name="height",value=256,size=4))
32: t.tr()
33: t.td(tt,colspan=2)
The okay button CLICK event is connected to the Dailog's
send event method. It will send a gui.CHANGE event.
82: t.tr()
83: e = gui.Button("Okay")
84: e.connect(gui.CLICK,self.send,gui.CHANGE)
85: t.td(e)
The dialog's CHANGE event is connected to this function that will display the form values.
104: def onchange(value):
105: print '-----------'
106: for k,v in value.value.items():
107: print k,v
108: value.close()
109:
110: dialog.connect(gui.CHANGE,onchange,dialog)