If you want a menu without using the global menubar, you will have to write your own top level menu.Īnd here's a person asking how to possible remove the menu at the top, in case you're interested in implementing your menu on the window itself: The Tk menu command is hooked into the Mac OS X global menubar. Otherwise, you'll end up with the "built-in" menubar, which contains menus that are only intended for use when typing commands directly into the interpreter. If you don't specify a menubar for a particular window, Tk will use the menubar associated with the root window you'll have noticed by now that this is automatically created for you when your Tk application starts.īecause on Mac OS X all windows have a menubar, it's important to make sure you do define one, either for each window or a fallback menubar for the root window. As far as your Tk program is concerned, each window still does have its own menubar as you switch between windows, Tk will automatically take care of making sure that the correct menubar is displayed at the top of the screen. On Mac OS X though, there is a single menubar along the top of the screen, shared by each window. Tk does not yet support this style of menus. You'll notice on some recent Linux distributions that many applications show their menus at the top of the screen when active, rather than in the window itself. I am using a Mac if that makes a difference.
0 Comments
Leave a Reply. |