Bob Klahn wrote:
Let's say I have a wx.grid grid containing 2000 rows, with text strings in column 0.
The user can scroll through this grid, just like any other grid, =or= can press a certain key combo, say <ctrl-?>. and be prompted for a search string. Say that search string is found in a handful of those 1000 rows. The application must quickly show the user just those rows.
The user could then press <ctrl-?> again and specify a different search string, at which point the application must be able to quickly show just those rows. Selected from the full 1000-row grid, not just from the currently-displayed rows. All without flicker.
The question: What's the best way to accomplish the above?
Do the magic in your table class. When you process the filter the table can figure out which rows match and how many there are, tell the grid how many are in the result set, tell it to redraw, and then map the requests that the grid will make to the real values. For example if the first matching row is 5 then when the grid asks for the value of a cell in the 0th row your table would give it the value from the real 5th row instead, and so on.
···
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!