How to force a Pmw ComboBox to update list

mark mark at diversiform.com
Thu Aug 28 02:20:58 CEST 2003


Ahh, something I can answer authoritatively (because I do it all the
time)!

Here's what you want:

ComboBoxName._list.setlist(list)

Now, if I understand this method correctly, (list) has to be a tuple.
Let me know if this isn't the case, but it seems like I'm doing some
convoluted things (like converting lists to tuples) to make this work
correctly.

You didn't mention whether or not you use dropdowns.  I am using them,
and this is how I update them.  If you don't, this may not work for you.

HTH,

Mark
-----Original Message-----
From: python-list-admin at python.org [mailto:python-list-admin at python.org]
On Behalf Of Marc
Sent: Wednesday, August 27, 2003 4:19 PM
To: python-list at python.org
Subject: How to force a Pmw ComboBox to update list

Hi all,

I have an application that uses a Pmw ComboBox to display a list that
is dynamic. The user has the ability to add and delete items from the
list at different points in the program.

However, once the list is updated it needs to automatically refresh
the ComboBox to reflect the updated list. The only way I have been
able to solve the problem so far is to redraw the window (by
withdrawing the window and calling the function that creates the
window again). I tried to do a 'configure' on the ComboBox, but
couldn't get it to work because the list itself was an initialization
even. However, I could have been doing that wrong.

Is there any way to force the ComboBox to update the list or redraw
itself with the new list?

Thanks ahead of time,
Marc
-- 
http://mail.python.org/mailman/listinfo/python-list







More information about the Python-list mailing list