Exemple #1
0
        def addwidget(frame, fname, fdata, r):
            var=None
            tvar=IntVar(); tvar.set(0)
            if type(fdata) in availabletypes:
                if type(fdata) == types.IntType:
                    var=IntVar()
                else:
                    var=StringVar()
                var.set(fdata)
                Label(frame, text=fname).grid(row=r,column=0,sticky='news',padx=4,pady=3)
                Entry(frame, textvariable=var, bg='white').grid(row=r,column=1,
                                            sticky='news',padx=4,pady=3)
            else:
                Label(frame, text=fname).grid(row=r,column=0,sticky='news',padx=4,pady=3)
                st = Pmw.ScrolledText(frame, borderframe = 1,
                                        labelpos = 'n', label_text=str(type(fdata)),
                                        text_wrap='none')
                st.grid(row=r,column=1,sticky='news',padx=4,pady=3)
                p = Utils.prettyPrint(fdata) #more readable
                st.setvalue(p)
                st.component('text').configure(height=6)
                st.component('text').configure(state=DISABLED)

            return var, tvar
Exemple #2
0
 def prettyPrint(self):
     """prints the entire dict"""
     x=Utils.prettyPrint(self.data)
     print x
     return