def dropdown(self, event=None):
    self.arrow['relief'] = 'sunken'
    self.entry.focus_force()
    self.entry.select_range(0, tk.END)
    menu = tk.Menu(self.entry, tearoff=0, bg='white')

    def changeentry(choice):
        self.entry.delete(0, tk.END)
        self.entry.insert(0, choice)
        self.rollup()
    if (self.direction == 'down'):
        choices = self.choices
    elif (self.direction == 'up'):
        choices = list(reversed(self.choices))
    for choice in choices:
        menu.add_command(label=repr(choice).ljust(30), command=(lambda x=choice: changeentry(x)))
    x = self.entry.winfo_rootx()
    if (self.direction == 'down'):
        y = (self.entry.winfo_rooty() + self.entry.winfo_height())
    elif (self.direction == 'up'):
        y = (self.entry.winfo_rooty() - menu.yposition(0))
    menu.post(x, y)
def dropdown(self, event=None):
    self.arrow['relief'] = 'sunken'
    self.entry.focus_force()
    self.entry.select_range(0, tk.END)
    menu = tk.Menu(self.entry, tearoff=0, bg='white')

    def changeentry(choice):
        self.entry.delete(0, tk.END)
        self.entry.insert(0, choice)
        self.rollup()
    if (self.direction == 'down'):
        choices = self.choices
    elif (self.direction == 'up'):
        choices = list(reversed(self.choices))
    for choice in choices:
        menu.add_command(label=repr(choice).ljust(30), command=(lambda x=choice: changeentry(x)))
    x = self.entry.winfo_rootx()
    if (self.direction == 'down'):
        y = (self.entry.winfo_rooty() + self.entry.winfo_height())
    elif (self.direction == 'up'):
        y = (self.entry.winfo_rooty() - menu.yposition(0))
    menu.post(x, y)