Feb-02-2019, 12:22 AM
from tkinter import * import Pmw class Combobox: def __init__(self): self.root = Tk() self.root.title('ComboBoxDialog') self.listed = ['Toyota','Honda','Mercerdise Benz','BMW','KIA','Ford','Peoguet','Nissan','Opel'] # self.build_combo() self.root.mainloop() # self.choose = None def build_combo(self): self.choose = Pmw.ComboBoxDialog(self.root,title='ComboBox',buttons=('Ok','Cancel'), defaultbutton = 'Ok',combobox_labelpos=N,label_text='Which Car?',listbox_width=22, scrolledlist_items=self.listed,selectioncommand=self.click) # self.choose.pack(side=TOP,padx=5,pady=5,expand=YES,fill=X) self.tkraise() def click(self, args): print(f'You choose {args}') self.choose.configure(label_text=args) if __name__ == '__main__': Combobox()Hi! Am trying to adapt coding in a 'class' since like almost all programmers uses it. But the issue here is that the 'frame' and title pops up but the content (ComboBoxDialog Widget) does not.
Please help me out? Thanks.