On Mon, 2003-09-01 at 03:06, Derek Fountain wrote:
> Is the QListBox selectedItem() method implemented? At the risk of looking a 
> complete newbie, which I am, why does this:
> 
> #!/usr/bin/python
> 
> import sys
> from qt import *
> 
> app=QApplication(sys.argv)
> 
> list=QListBox()
> list.insertItem("Item 1")
> list.insertItem("Item 2")
> list.insertItem("Item 3")
> 
> list.setSelected( 1, True )
> print list.selectedItem()
> 
> app.setMainWidget(list)
> list.show()
> app.exec_loop()

I don't know about setSelected, I typically use setCurrentItem().  Try:

list.setCurrentItem(0)

-- 
Michael Andrews <[EMAIL PROTECTED]>

_______________________________________________
PyKDE mailing list    [EMAIL PROTECTED]
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde

Reply via email to