|
|
>>>import Tkinter
>>>from ViewerFramework.gui import InputFormDescr
>>>from ViewerFramework.customizedWidgets import ListChooser
>>>idf = InputFormDescr(title = 'ListChooser')
>>>#items with associated comments
>>>itemswithcomments=[('Charles','San Diego'),('Erik','San Francisco'),
('Robert','New York'), ('Paul', 'Chicago')]
>>>#listbox widget description
>>>listboxwcfg = {'width':10,'height':5}
>>># scrolledtext for the comments description.
>>>commentwcfg = {'labelpos':'n',
'label_text': 'comments',
'borderframe': 2,
'usehullsize':1,
'hull_width':100,
'hull_height':80,
'text_wrap':'none'}
>>>idf.append({'widgetType':ListChooser,'name':'lc1',
'wcfg':{'title':'With Comments',
'entries':itemswithcomments,
'mode':'single',
'lbwcfg':listboxwcfg,
'cwcfg':commentwcfg },
'gridcfg':{'sticky':'w'}})
>>>val = self.vf.getUserInput(idf)
|