How to determine row position in a list box

Scott Holmes scottholmes at
Tue Aug 5 02:13:40 CEST 2003

I've been trying to understand nearest(y) but I'm not getting it.  I 
have a ScrolledListBox with a list of people's names.  I also have a 
parallel list of the unique people numbers used in the PostgreSQL 
database.  When a name is selected from the scrolled list, I need to 
determine the index value and then find the corresponding people number.

     def selectionCommand(self):
         sels =
         if len(sels) == 0:
             print 'No selection'
             print 'Selection:', sels[0]
             print self.nmbr_list[[0].nearest(y)]

Where do I obtain the value y used in nearest(y)?

Scott Holmes         
                                scottholmes at

   Independent Programmer/Analyst                  Passport 4GL
   PHP HTML Composer                PostgreSQL     Informix 4GL, SQL
       There are more things in heaven and earth, Horatio,
              than are dreamt of in your philosophy

More information about the Python-list mailing list