SetGridCursor not working?

Dani Valverde dani.valverde at gmail.com
Wed Sep 22 13:46:24 EDT 2010


Hello!
I have a table with some rows and cells (code at the end), and created a 
function which searches for text inside the cells and returns the row 
number where the text is (to simplify the example, only English Name is 
working). Then, it should set the grid cursor focus to that row (I want 
to use the wx.grid.Grid.SelectRows style when created the wx.Grid, but 
to reduce the number of variables I don't use it in the example). To set 
the cursor focus, I am using

def OnSearch(self, event):
     CommonName = self.CommonNameTXT.GetValue()
     if CommonName != '':
         ind = self.parent.EnglishNameList.index(CommonName)
         self.parent.SpeciesGrid.SetGridCursor(ind, 0)
         self.parent.SpeciesGrid.MakeCellVisible(ind,0)

Theoretically, it should work using only the SetGridCursor method, 
however somewhere I have read that it will not work unless you also use 
the MaceCellVisible method as well. Anyway, it does not work at all. Can 
anyone help?

Dani

-- 
Daniel Valverde Saubí
c/Joan Maragall 37 4 2
17002 Girona
Spain
Telèfon mòbil: +34651987662
e-mail: dani.valverde at gmail.com
http://www.acrocephalus.net
http://natupics.blogspot.com

Si no és del tot necessari, no imprimeixis aquest missatge. Si ho fas utilitza paper 100% reciclat i blanquejat sense clor. D'aquesta manera ajudaràs a estalviar aigua, energia i recursos forestals.  GRÀCIES!

Do not print this message unless it is absolutely necessary. If you must print it, please use 100% recycled paper whitened without chlorine. By doing so, you will save water, energy and forest resources. THANK YOU!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: dani_valverde.vcf
Type: text/x-vcard
Size: 296 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20100922/9bee6ae0/attachment.vcf>


More information about the Python-list mailing list