From: Schollnick, B. <Ben...@xe...> - 2005-07-19 14:08:16
|
> Should be something like on_myList_itemActivated() Ah... I see.. Obvious.... =20 That's now working... Now regarding the reset of the selected item on a multicolumn list... def gather_data ( self ): current_item =3D self.last_picked[0] highlited =3D -1 for x in xrange(0, len(self.components.MultiColumnList1.items)): if current_item =3D=3D self.components.MultiColumnList1.items[x][0]: highlited =3D x break =20 vsoftware =3D None self.components.MultiColumnList1.items =3D [] self.components.MultiColumnList1.columnHeadings =3D [] headings =3D [] vsoftware, structure =3D self.odbc_database.select_statement ( fetch=3D"*", table=3Dself.database_name, orderby=3Dself.orderbys) for x in structure: headings.append ( x[0].replace("_", " ") ) self.components.MultiColumnList1.columnHeadings =3D headings data =3D [] line =3D [] for x in vsoftware: for y in x: line.append ( str(y) ) data.append ( line ) line =3D [] self.components.MultiColumnList1.items =3D data print dir(self.components.MultiColumnList1) self.components.MultiColumnList1.SetFocus ( highlited ) The penalty is too high..... Here's some background. The multicolumn list is a representation of what data is in a database (accessed via ODBC)... The gather_data function is used to refresh the data in the database view... After any changes (Editting, Adding, Removing) I need to refresh, but the table could be 400+ entries. It would be rather annoying for a user to make a change at the end of the table, and then have the table refreshed, and have to scroll all the way down to the end (again)..... SetSelection works to highlight the text. But it doesn't change the visible portion of the table to be in the viewing area....=20 The verified Software table is only roughly 100+ items, but if I use the for loop... for x in xrange(0, len(self.components.MultiColumnList1.items)): if current_item =3D=3D self.components.MultiColumnList1.items[x][0]: highlited =3D x break It adds roughly a 1-2 seconds to the load process.... Any suggestions? - Benjamin >=20 > --=20 > Alex Tweedly http://www.tweedly.net >=20 >=20 >=20 > --=20 > No virus found in this outgoing message. > Checked by AVG Anti-Virus. > Version: 7.0.323 / Virus Database: 267.9.0/50 - Release Date:=20 > 16/07/2005 >=20 >=20 |