[Q]Popping up ComboBox

Seung-won Hwang shwang5 at students.uiuc.edu
Sat Aug 11 09:27:26 CEST 2001

Hi, I'm newbie in Tkinterprogramming. I'd like to pop up the form as below
in the callback function of menubar and keep failing... Any code example or
help would be very helpful to me.



from Tkinter import *
from tkSimpleDialog import Dialog
import Pmw

class MixedWidgets(Dialog):

    def body(self, master):
        Label(master, text='Select ').grid(row=0, sticky=W)
        Label(master, text='Select ').grid(row=1, sticky=W)
        Label(master, text='Enter ').grid(row=2, sticky=W)

        self.combo1 = Pmw.ComboBox(master,

                                   entry_width=12, entry_state="disabled")

        self.combo2 = Pmw.ScrolledListBox(master,

        self.entry1  = Entry(master, width = 12)

        self.combo1.grid(row=0, column=1, sticky=W)
        self.combo2.grid(row=1, column=1, sticky=W)
        self.entry1.grid(row=2, column=1, sticky=W)

        return self.combo1

    def apply(self):
        c1 = self.combo1.get()
        c2 = self.combo2.get()
        e1 = self.entry1.get()
        print c1, c2, e1

root = Tk()
dialog = MixedWidgets(root)

More information about the Python-list mailing list