def __init__(self): self.scandbs = vistadbscan.run() print self.scandbs self.builder = gtk.Builder() self.builder.add_from_file("dbswitcher2.14.glade") self.window = self.builder.get_object("window1") self.window.show() self.box=self.builder.get_object("combobox1") cell = gtk.CellRendererText() self.box.pack_start(cell, True) self.box.add_attribute(cell, 'text', 0) store = gtk.ListStore(str) #self.builder.get_object("entry1").set_text('click test button') store.append(["Choose a Database"]) dic = { "on_button1_clicked" : self.switchdbs, "on_combobox1_changed" : self.combobox1_changed, } self.builder.connect_signals(dic) for d in self.scandbs: store.append([d]) #note: append a list self.box.set_model(store) #this replaces the model set by Glade self.box.set_active(0) self.box.show() curstage = os.environ['STAGE'] self.builder.get_object("label2").set_label('Current DB: '+curstage)
def __set_properties(self): # begin wxGlade: MyDialog.__set_properties self.SetTitle("dialog_dbswitcher") self.SetFocus() # end wxGlade self.scandbs = vistadbscan.run() self.choice_1.SetItems(self.scandbs)
def dbswitcher(self, event): # wxGlade: MyFrame.<event_handler> print "Event handler `dbswitcher' not implemented" self.scandbs = vistadbscan.run() print self.scandbs switcherdialog.Show()