How to determine row position in a list box

S

Scott Holmes

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 = self.box.getcurselection()
if len(sels) == 0:
print 'No selection'
else:
print 'Selection:', sels[0]
print self.nmbr_list[self.box[0].nearest(y)]
self.lkupTopLevel.withdraw()

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

--
---------------------------------------------------------------------
Scott Holmes http://sholmes.ws
http://pages.sbcglobal.net/scottholmes
(e-mail address removed)

Independent Programmer/Analyst Passport 4GL
PHP HTML Composer PostgreSQL Informix 4GL, SQL
 
D

Daniel P. Engel

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

Wouldn't that be sels[0]?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top