Scrollbar problem when adding lines to a WxGrid

Hi everybody,

I'm using a single-column wxGrid in order to make an image list, where
you could add/select/remove images. So since I'm a very beginner in Wx,
I've started with a simple wxGrid example. Unfortunately, when I add an
item and the DC of the grid overlaps the frame, no scrollbar does appear
until I resize the window. While I'm sure there is an easy solution for
that and that I'm missing something obvious, I can't find what even
after a lot of searching.

Attached is the source code. If you want to test it, do enough Ctrl-a to
see what the problem is. Any clue or pointer would be welcome.

Thanks in advance,
Alex.

test.py (2.34 KB)

···

--
http://www.gnurou.org

Try call wxGrid.AdjustScrollbars()

Marius


Alexandre Courbot wrote:

···

wxPython-users-unsubscribe@lists.wxwindows.org
wxPython-users-help@lists.wxwindows.org


Try call wxGrid.AdjustScrollbars()

Unfortunately this doesn't seem to work. Moreover AdjustScrollbars is
just "None" when I try to print it. Have I missed something here?

Alex.

···

--
http://www.gnurou.org

Alexandre Courbot wrote:

Try call wxGrid.AdjustScrollbars()

Unfortunately this doesn't seem to work. Moreover AdjustScrollbars is
just "None" when I try to print it. Have I missed something here?

Yes. As suggested, this works:

     def OnMenuImageAdd(self, event):
         self.list.AppendRows(1)
  self.list.AdjustScrollbars()
  ...

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!