def __init__(self, listCategories): """ listCategories: initial list of categories to fill the fields """ GenericDialogPlus.__init__(self, "Category names") self.addPanel( Panel(GridLayout(0,1)) ) self.panel = self.getComponent(0) for category in listCategories: self.panel.add( TextField(category) ) # Add string input to GUI self.addButton(CategoryDialog.ADD_CATEGORY, self)
def __init__(self, title, message, panel): GenericDialogPlus.__init__(self, title) self.setModalityType(None) # like non-blocking generic dialog self.setOKLabel(CustomDialog.LABEL_OK) self.addMessage(message) self.addPanel(panel) # custom panel, cannot be replaced by a JPanel