Assuming there is a program that uses Tkinter to create a GUI page with a menu, I need to make the menu text change (such as changing from File (F) to File (\underline {\text{F}}) when it detects the user pressing the Alt key, just like in IDLE). How should I proceed? Thank you So Much!
In add_cascade calls, include this option: underline=char_index, where char_index is the 0-based index of the character you want indexed. For the top-level menu, at least on Windows, the underline only appears when Alt is pressed. (This is what IDLE does in Lib/idlelib/editor.py in createmenubar, line 480.) See this menu doc for more.