##I KNOW that the following method is called: def show_char_select(self, names): print "Show char select called in main_window in widgets.py" if self.state != main_window.NAME_SELECT_STATE: raise WrongOrderException() #TODO Add in a name widget. QInputDialog? name = self._show_chooser(names) self._incr_state(name) #The following class is before the class in the method. class chooser_window (QDialog, object): def __init__(self, names): super(chooser_window, self).__init__() self.names = names self.layout = QGridLayout(self) self.setup() #TODO Add more stuff. def setup(self): combo_box = QComboBox(self) for name in self.names: combo_box.addItem(name) combo_box.editable = False xpos = 0 ypos = 0 self.layout.addWidget(combo_box, xpos, ypos) ypos += 1