python - tkinter option menu doesn't display selection -
I have a python / typewriter program through the Options menus, which works fine, though in the second window (a window The main window that opens and has a separate vaccine execution) option option is not visible in the Options menu. I have tested and the option has been selected and I can use it, it just does not display.
The following class is called from the main window:
class Ftp_window: def __init __ (self): root = Tk () root.resizable (width = FALSE, height = FALSE) root.title ( "unity Acesso ao FTP") root.iconbitmap ( "icon.ico") note = Notebook (root) self.tab1 = Frame (Note) self.tab2 = Frame (Note) note.add (Self.tab1, text = "Acessar basases") add. (Self.tab2, text = "analysis") root.minsize (600,500) root.immetry ("600x500") self.ftp_apelido = StringVar () self.ftp_apelido .set ("select") self.varvoz = StringVar () self.tab_one () note.pack () root.mainloop () Def get_list_of_apelidos (auto): '' sqlite3 connection '' for FTP connection '' 'conn = sqlite3. Connect ("settings.db") c = conn.cursor () c.execute ("ftp_server_login Unen ") result = Ckfetchall (for line results) list = (): If not Reksearch (row [4], str (list)) list + = (row [4]) Others: Return List def def print (self, * args): '' 'Used when displaying stringvar.' '' Print RGR Print itself Ftp_apelido.get () def tab_one (self): '' makes first tab and widgets' Main_tab_one_frame = Frame (self.tab1) main_tab_one_frame.config (width = 300) main_tab_one_frame.grid (column = 0, row = 0, sticky = NSEW, rowspan = 10, columnpan = 10) apelidos_Entry = OptionMenu (main_tab_one_frame, self.ftp_apelido, self.ftp_apelido.get), * self.get_list_of_apelidos ()) apelidos_Entry.config (width = 25) apelidos_Entry.grid (column = 3, row = 3) vozEntry = OptionMenu (main_tab_one_frame, self.varvoz, '', '', 'SIM' NAO ') vozEntry.config (width = 15) vozEntry.grid (column = 1, row = 4)Tk , then this is the least. Part of the problem you only ever need to create an instance of the tfor your entire application, and you should only everMainloopcall just once. You need more windows You should make examples ofHigh Level.
Comments
Post a Comment