Logo Search packages:      
Sourcecode: qa-assistant version File versions  Download package

def propview::PropertiesView::create_layout (   self  ) 

Definition at line 34 of file propview.py.

00034                            :
        '''
        '''
        props = self.model
        if not props:
            label = gtk.Label('This CheckList does not contain any properties.')
            self.add(label)
            label.show()
            return
        self.labels = []
        self.entries = []
        self.propDisplays = {}

        for propName in props.keys():
            if props[propName].propType == 'automatic':
                value = props[propName].value or '<No value>'
                self.propDisplays[propName] = gtk.Label(value)
                outPropName = None
            else:
                value = props[propName].value or ''
                entry = gtk.Entry()
                entry.set_text(value)
                entry.connect('focus-out-event', self._change_property,
                        propName)
                self.propDisplays[propName] = entry
                if props[propName].propType == 'onload':
                    outPropName = '<span foreground="red" style="italic">' \
                            + propName + '</span>'
                else:
                    outPropName = None
            label = gtk.Label()
            if outPropName:
                label.set_markup(outPropName)
            else:
                label.set_text(propName)
            self.labels.append(label)
            label.show()
            self.entries.append(self.propDisplays[propName])
            self.propDisplays[propName].show()

        self.layout = gtk.Table(len(self.labels), 2, False)
        self.layout.set_property('row-spacing', 5)
        for row in range(0, len(self.labels)):
            self.layout.attach(self.labels[row], 0, 1, row, row + 1)
            self.layout.attach(self.entries[row], 1, 2, row, row + 1)
        self.add(self.layout)
        self.layout.show()

    def _change_property(self, entry, event, propName):


Generated by  Doxygen 1.6.0   Back to index