I've been diving into Python 3/Tkinter and would like to create a menubutton inside of a frame that, when clicked on, will drop down a list of options with radio buttons. Ideally, I would like to set indicatoron=0 for my radio buttons, but have ran into an issue with my code where the menubutton will not appear in the app window. All guides I've looked at demonstrated the ability to set a radio button list under the Menu Bar or creating a menubutton with a list of checkbutton options.
When you run this code, it prompts an empty window with the 'minimize - expand - close' buttons. Once you expand the app window, nothing is displayed.
from tkinter import *
class TestMenu:
def __init__(self, master):
self.master = master
self.menubar = Menubutton(self.master, text='Menubutton', relief=RAISED,
activebackground='#3399ff', bg='white', fg='black')
mbmenu = Menu(self.menubar, tearoff=0)
mb_radmenu = Menu(mbmenu)
mb_radmenu.add_radiobutton(label='A')
mb_radmenu.add_radiobutton(label='B')
mb_radmenu.add_radiobutton(label='C')
mbmenu.add_cascade(menu=mb_radmenu)
self.top = Toplevel(menu=self.menubar, width=200, relief=RAISED, borderwidth=2)
def main():
root = Tk()
root.withdraw()
app = TestMenu(root)
root.mainloop()
if __name__ == '__main__':
main()