[wxPython-users] grid.MakeVisible() not working for me
Robin Dunn
robin at alldunn.com
Wed Jan 2 16:58:04 PST 2008
Stuart McGraw wrote:
>
> This seems likely to be pilot error since it seems
> it would have been noticed by now if it was wxPython
> problem, but I'm not seeing it...
>
> I create a grid with more rows than can be shown and
> it displays as expected with vertical scrollbars and
> displaying cell (0,0) in the top left corner.
>
> But if I call the Grid method MakeCellVisible(0,0)(which
> I presume should have no effect since the cell is already
> visible), the grid is scrolled down so that only the bottom
> border of the top row is visible.
>
> Conditionalizing the call using .IsVisible(0,0) doesn't
> help because it seems to return false, even though the
> cell *is* visible. Nor is problem limited to row 0, it
> occurs with any row number.
>
> As I said, I strongly suspect I am doing something wrong
> and would appreciate a clue. :-)
When the Frame.__init__ is called then the frame still hasn't been
shown, so it hasn't been sized yet, and so there has been no size event
to cause the layout of the sizer, and so the grid can still be
considered as having an undefined size. (Actually it's probably 20x20.)
So at the time you call MakeVisible it is doing it's best to do what
you ask, but thinks it only has a very small number of pixels to do it in.
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
More information about the wxpython-users
mailing list