Re: Get selected Item in List

Matt Minton <[email protected]>
Newsgroups gmane.comp.python.pythoncard
Message-ID <[email protected]>
--- Kwasir <[email protected]> wrote:

> Hi everyone!
> 
> Can someone give me a hint how to get the ID of an
> selected Item in a 
> list? Currently I do have a list and and adding is
> no problem. But when 
> I select an Item, I do not find any method in the
> documentation, that 
> gives me the ID of the current item, so that I
> can do "List.delete(self, aPosition)".
> So there should be some method which returns the
> aPosition, or a property.
> Am I too tired to see it?
> 
> Thank you!

Lists in PythonCard are list any other Python lists,
and all the usual list comprehensions and methods work
just fine. Example:

If myList is the list in question and
"string_in_myList" is an element of the list, then

listIndex = myList.index("string_in_myList")

will assign the index of "string_in_myList" in myList
to listIndex.

Enjoy!

- Matt Minton



 
____________________________________________________________________________________
Expecting? Get great news right away with email Auto-Check. 
Try the Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html 

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.