Tkinter: OptionMenu question

Peter Funk pf at artcom-gmbh.de
Thu Mar 9 06:02:07 EST 2000


Hi!

Randall Hopper:
> How do you set the font?
> 
> This:
> 
>     menu = apply( OptionMenu, ( parent, var ) + tuple( option_names ),
>                   { 'font':PANEL_FONT } )
> 
> generates:
> 
>     TypeError: unexpected keyword argument: font

Since 'Tkinter' itself contains no class 'OptionMenu', I guess you
are using the fine Pmw package by Greg McFarlane.  The option
menu provided by Pmw contains several atomic widgets as components.
So you have to decide to which component your font attribute
should belong:

      menu = apply( Pmw.OptionMenu, ( parent, var ) + tuple( option_names ),
                    { 'menubutton_font':PANEL_FONT } )

Hope this helps, Peter
-- 
Peter Funk, Oldenburger Str.86, D-27777 Ganderkesee, Germany, Fax:+49 4222950260
office: +49 421 20419-0 (ArtCom GmbH, Grazer Str.8, D-28359 Bremen)




More information about the Python-list mailing list