tk_menuBar(3tk)

✨ tk_menuBar β€” bestie, it's a ghost πŸ‘»

ok so real talk, this page is literally about tk_menuBar and tk_bindForTraversal, from the Tk Built-In Commands manual. and the tea is: these two are obsolete. they're the friends who said "omg we should hang out" in 1998 and never texted back. πŸ’€


🌸 NAME 🌸

tk_menuBar, tk_bindForTraversal β€” obsolete support for menu bars

like. obsolete. that's the whole job description. 🫠


πŸŽ€ SYNOPSIS πŸŽ€

tk_menuBar frame ?menu menu ...?

tk_bindForTraversal arg arg ...

πŸ’… DESCRIPTION πŸ’…

okay so here's the lore πŸ“œ:

These procedures were used back in Tk 3.6 and earlier releases to help manage pulldown menus and to implement keyboard traversal of menus. iconic behaviour for its time, no notes. ✨

but then Tk 4.0 and later releases rolled around and they are no longer needed. not "kind of unneeded." not "optional." no longer needed, periodt. πŸ’…

Stubs for these procedures have been retained for backward compatibility, but β€” and this is the part that matters β€” they have no effect. like, calling them is basically yelling into the void. the void is polite about it, but still. 😭

⚠️ bestie listen: you should remove calls to these procedures from your code, since eventually the procedures will go away. not "might." will. so clean it up now while it's still just a no-op and not a full-on crash situation. πŸ™ˆ

and from Tk 8.0 onwards, here's the move you actually want: instead, you should construct your menubar as a normal menu and then attach it to the toplevel of your choice using the -menu option of that widget. that's it. that's the whole glow-up. 🌟


πŸ¦‹ SEE ALSO πŸ¦‹


πŸ‘‘ KEYWORDS πŸ‘‘

  • keyboard traversal
  • menu
  • menu bar
  • post

and that's the page!! mwah πŸ’– this was tk_menuBar(3tk), hanging out in the Tk Built-In Commands manual, brought to you by the letter Tk β€” tysm for reading, go delete those calls, ily, bye bestie πŸŽ€βœ¨πŸ«Ά

πŸ“¦ where this page comes from