0

I want to show a dropdown menu when myBtn is pressed but don't know how.

myBtn = Button(self, image=BoxImg.png, bd=0, borderwidth = 0, highlightthickness = 0)

BoxImg.png:

enter image description here

So when this image is pressed (Which is the button) I want it to show something like this where every line is clickable:

enter image description here

I found this method from this post and the only problem with it is that, to show the dropdown menu we should press on this thing: enter image description here (that isn't a button), but I want it to be a button so that I can configure to it the image BoxImg.png (Btn.configure(image='BoxImg.png'))

The_Fishy
  • 143
  • 10
  • Does this answer your question? [How can I create a dropdown menu from a List in Tkinter?](https://stackoverflow.com/questions/45441885/how-can-i-create-a-dropdown-menu-from-a-list-in-tkinter) – Ryan Zhang Jul 10 '22 at 08:00
  • @RyanZhang no cause here it's not a button that's used, to show the dropdown menu we should press on [this thing](https://ibb.co/g6VptPr), but I want it to be a button so that I can configure to it the image `BoxImg.png` – The_Fishy Jul 10 '22 at 08:33
  • Try using `Menubutton`. – acw1668 Jul 11 '22 at 00:25
  • Instead of `ttk.Menubutton` try `tk.Menubutton(self, indicatoron = 0, direction = "below", compound = tk.LEFT, relief = "groove", image = image)`. This will give you a button like object with potential for an image. – Derek Jul 11 '22 at 03:54

0 Answers0