I have done all my codings, ui creation etc into a single file and I would 
like to separate between my main functions (manager_main.py) and the ui 
(manager_ui.py) into 2 files
Just so you know, I created my widgets 'manually' instead of using Qt 

class manager_ui(QtGui.QDialog):
    def __init__(self, parent=None):
        QtGui.QDialog.__init__(self, parent)
        self.setWindowTitle('UI Manager')

        # Build the GUI
        self.resize(QtCore.QSize(600, 350))

    def init_ui(self):
        self.color_table = QtGui.QTableWidget()
        self.color_table.setHorizontalHeaderLabels(['Geos in Scene',
        self.set_color_btn = QPushButton()

    def connect_signals(self):
    def reset_color(self):
        for row in xrange(self.variant_table.rowCount()):
            self.color_table.cellWidget(row, 1).setCurrentIndex(0)

    def populate_data(self):
        self.color_combobox = QtGui.QComboBox()
        self.color_table.setCellWidget(index, 1, self.color_combobox)

Suppose if I am going to shift the reset_color function into the main file, 
I do got errors stating that self.variant_table, where self is not defined 
etc. I also tried importing in the ui file into the main script and renamed 
it to something such as 'mangaer_ui.variant_table.cellWidget...' still I am 
getting errors.

And so my question would be, in the various functions I have wrote, and 
especially within the functions in which I have stated the widget creations 
variables I have defined (self.color_table, self.set_color_btn etc), I 
suppose I am not able to move it into the main file at all? If it is, what 
is the best way to approach it?

Additionally, was wondering if anyone could give me any insights on what to 
look out for when splitting the file into a main and a ui file?

You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
For more options, visit https://groups.google.com/d/optout.

Reply via email to