Tkinter add_cascade option_add

Bob Greschke bob at passcal.nmt.edu
Wed Sep 14 11:58:25 EDT 2005


You can set the font for the labels on the menu bar, and you can set the 
font of the items in the drop down portion independently (except on Windows 
where you cannot control the font of the menu bar labels).  I just don't 
know how to set the font for the menu bar labels using an option_add 
command.

...option_add("*Menu*font", "Helvetica 12 bold")  works fine
...option_add("*Cascade*font", "Helvetica 12 bold")  does not,

because I can't figure out what to put in for "Cascade".  There must be 
something, because I can use font = "Helvetica 12 bold" in the add_cascade 
command OK (see below).

The program runs on Windows, Linux, Solaris, Mac.

Bob

"Eric Brunel" <eric_brunel at despammed.com> wrote in message 
news:opsw2yqkilrqur0o at eb.pragmadev...
> On Tue, 13 Sep 2005 22:31:31 -0600, Bob Greschke <bob at greschke.com> wrote:
>
>> Root.option_add("*?????*font", "Helvetica 12 bold")
>>
>> Want to get rid of the "font =":
>> Widget.add_cascade(label = "File", menu = Fi, font = "Helvetica 12 bold")
>>
>> Does anyone know what ????? should be to control the font of the cascade
>> menus (the labels on the menu bar)?  "*Menu*font" handles the part that
>> drops down, but I can't come up with the menu bar labels part.
>
> option_add('*Menu.font', 'helvetica 12 bold') works for me for all sorts 
> of menu items (cascade, commands, checkbuttons, whatever...).
>
> What is your platform? There may be a few limitations for menu fonts on 
> Windows.
>
> HTH
> -- 
> python -c "print ''.join([chr(154 - ord(c)) for c in 
> 'U(17zX(%,5.zmz5(17;8(%,5.Z65\'*9--56l7+-'])" 





More information about the Python-list mailing list