wx.grid.AutoSizeColumns() doesn't

This must be my error, but I don't see where. With wxPython-2.8.0.1 I have
these lines:

        self.dataGrid = wx.grid.Grid(self)
        self.dataGrid.AutoSizeColumns(setAsMin=True)
        self.dataGrid.CreateGrid(self.nRows, self.nCols, selmode=wx.grid.Grid.SelectCells)

yet, when I load data into the grid widget, the columns are not resized to
the largest string in each one.

    Is the syntax incorrect?

    Do I have the AutoSize command in the wrong order?

    My trial-and-error efforts to figure out what I'm doing incorrectly
haven't worked.

TIA,

Rich

···

--
Richard B. Shepard, Ph.D. | Integrity Credibility
Applied Ecosystem Services, Inc. | Innovation
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863

Rich Shepard wrote:

   This must be my error, but I don't see where. With wxPython-2.8.0.1 I have
these lines:

         self.dataGrid = wx.grid.Grid(self)
         self.dataGrid.AutoSizeColumns(setAsMin=True)
         self.dataGrid.CreateGrid(self.nRows, self.nCols, selmode=wx.grid.Grid.SelectCells)

yet, when I load data into the grid widget, the columns are not resized to
the largest string in each one.

   Is the syntax incorrect?

   Do I have the AutoSize command in the wrong order?

AutoSizeColumns does not mean that the columns will be automatically adjusted forever, they are just adjusted at the time the method is called, using the values that are currently in the grid to determine the size needed. If you need it to be done again later then you need to call the method again.

···

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