返回顶部

收藏

Menu item mouse on (active) foreground color

更多
from Tkinter import *

class TestMenu:
    def __init__(self, master):
  self.master = master
  self.menubar = Menu(self.master)

        self.cmdmenu = Menu(self.menubar)

        self.cmdmenu.add_command(label='Quit', underline=0, 
                                 background='white', activebackground='green', 
                                 command=self.master.quit)

        self.unused = Menu(self.menubar)

        self.menubar.add_cascade(label='Button Command', menu=self.cmdmenu)

  self.top = Toplevel(menu=self.menubar, width=500, relief=RAISED,
                            borderwidth=2)

def main():
    root = Tk()
    root.withdraw()
    app = TestMenu(root)
    root.mainloop()

if __name__ == '__main__':
    main()

标签:Python,Event

收藏

0人收藏

支持

0

反对

0