Pmw.ComboBox

Eric Brunel eric.brunel at N0SP4M.com
Wed Dec 10 13:10:10 EST 2003


mark wrote:
> I guess I would wonder why you'd use a ComboBox that you didn't want
> someone to select anything from, but maybe you are disabling the widget
> conditionally.  At any rate:
> 
> Nochoice = Pmw.ComboBox()
> Nochoice._entryWidget['state'] = DISABLED

You shouldn't do that: as indicated by the leading underscore, _entryWidget is 
an internal field and shouldn't be accessed directly. So upgrading your Pmw 
version may someday break your code. The portable way to do what you want is:

NoChoice.configure(entry_state=DISABLED)

or:

NoChoice['entry_state'] = DISABLED

if you prefer this syntax.

> Now, this is effectively disabling the entire widget, since it won't put
> anything in the entry box.  I'm not certain if this is what you're
> looking for, but it works for me.
> 
> - Mark
> 
> -----Original Message-----
> From: python-list-bounces+mark=diversiform.com at python.org
> [mailto:python-list-bounces+mark=diversiform.com at python.org] On Behalf
> Of Gombos Katalin
> Sent: Wednesday, December 10, 2003 8:14 AM
> To: python-list at python.org
> Subject: Pmw.ComboBox
> 
> Hi,
> 
> How could I make the ComboBox state disabled?
> 
> I don't want to let anybody to scroll the listbox of the ComboBox.
> 
> Thank You!
> 
> Katux

HTH
-- 
- Eric Brunel <eric dot brunel at pragmadev dot com> -
PragmaDev : Real Time Software Development Tools - http://www.pragmadev.com





More information about the Python-list mailing list