Re: names and values lists in lbc.AddListBox?

  • From: Jamal Mazrui <empower@xxxxxxxxx>
  • To: programmingblind@xxxxxxxxxxxxx
  • Date: Thu, 03 Jun 2010 10:37:08 -0400

Look at test_lbc.py. The DialogPick method uses a listbox with a pair of Python lists corresponding to names and values. Each name has a corresponding value. The listbox shows names, but returns values.


Values can be the same as names, but they do not have to be. For example, you might show titles of songs in the listbox, but when the user picks one to play, you want the path of the MP3 file on disk to be returned by that method. So, you set up two parallel lists as parameters, where each song in the names list corresponds to a path in the values list.

If you do not need different values from names, just set the values list equal to the names list.

Jamal


On 6/3/2010 9:33 AM, Alex Hall wrote:
__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind

Other related posts: