I''m using the grid widget with an underlying GridTableBase and trying to implement a "Find" button which would cause the current cursor position to go to the next matching cell. I''m wondering if there''s an easy way to do it? I''m playing with the Grid.select_block_row(), Grid.set_grid_cursor() and Grid.scroll() methods, but the results are a bit erratic. Is there a better way to do this than using Grid.move_cursor_down/right? Thanks, Norbert -- Posted via http://www.ruby-forum.com/.
It took a bit of time and experimenting, but this seems to work, for anyone else who''s maybe run into the same issues. Here''s the code I came up with for scrolling to a grid position given a cell row and column. I hope someone finds it useful. Norbert Attachments: http://www.ruby-forum.com/attachment/7431/Setting_Grid_Cursor_Example.rb -- Posted via http://www.ruby-forum.com/.
A bit of a tweak in case someone has used this code. The original didn''t take into account the width and height of the row and column labels in calculating whether to reposition the grid. Norbert Attachments: http://www.ruby-forum.com/attachment/8492/Setting_Grid_Postion_Example_2.rb -- Posted via http://www.ruby-forum.com/.