Exemple #1
0
    def appendRow(self, data):
        r = len(self.__widgets) + 1
        c = 0
        dataIdx = 0
        actualRow = []

        for columnData in data:
            widget = None
            if r > 1 and c == 0:
                widget = Button(self.__widgetFrame,
                                text=columnData,
                                width=World.smallButtonWidth(),
                                command=lambda: self.__editRow(data))
            else:
                if dataIdx not in self.__invisibleColumns:
                    widget = Label(self.__widgetFrame, text=columnData)

            if widget != None:
                widget.grid(row=r,
                            column=c,
                            sticky="ns",
                            padx=World.smallPadSize(),
                            pady=World.smallPadSize())
                actualRow.append(widget)
                c += 1

            dataIdx += 1

        self.__widgets.append(actualRow)
        self.__data.append(data)
Exemple #2
0
 def appendRow(self, data):
     r = len(self.__widgets)+1
     c = 0
     dataIdx = 0
     actualRow = []
     
     for columnData in data:
         widget = None
         if r > 1 and c == 0:
             widget = Button(self.__widgetFrame, text=columnData,
                             width=World.smallButtonWidth(),
                             command= lambda: self.__editRow(data))
         else:
             if dataIdx not in self.__invisibleColumns:
                 widget = Label(self.__widgetFrame, text=columnData)
                 
         if widget != None:                
             widget.grid(row=r, column=c, sticky="ns",
                         padx=World.smallPadSize(), pady=World.smallPadSize())
             actualRow.append(widget)
             c += 1
             
         dataIdx += 1
         
     self.__widgets.append(actualRow)
     self.__data.append(data)
Exemple #3
0
 def _createControls(self):
     self.__plusButton = Button(self, text='+', 
                                width=World.smallButtonWidth(),
                                command=self.__appendRow)
     self.__plusButton.grid(row=1, column=0,
                            padx=World.smallPadSize(),
                            pady=World.smallPadSize(),
                            sticky="SW")
Exemple #4
0
 def _createControls(self):
     self.__plusButton = Button(self,
                                text='+',
                                width=World.smallButtonWidth(),
                                command=self.__appendRow)
     self.__plusButton.grid(row=1,
                            column=0,
                            padx=World.smallPadSize(),
                            pady=World.smallPadSize(),
                            sticky="SW")