Pmw.ComboBox

mark mark at diversiform.com
Wed Dec 10 19:42:38 CET 2003


Excellent!  See, always something to learn around here.

- 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 Eric Brunel
Sent: Wednesday, December 10, 2003 10:10 AM
To: python-list at python.org
Subject: Re: Pmw.ComboBox

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

-- 
http://mail.python.org/mailman/listinfo/python-list







More information about the Python-list mailing list