[wxPython-users] A couple of questions...

Jerry LeVan jerry.levan at gmail.com
Thu Apr 26 13:29:32 PDT 2007


On Apr 26, 2007, at 2:51 PM, Robin Dunn wrote:

> Jerry LeVan wrote:
>> Hi,
>> I recently picked up wxPython In Action and installed
>> 1) Python 2.5.1 and wxPython 2.8.3 on my mac osx 10.4.9 system
>> 2) Python 2.4.4 and wxPython 2.6.3 on my linux fc6 machine.
>> In running through some examples from the source code in the wIA book
>> I found that the Grid examples in Chapter 14 did not work properly.
>> In particular, when scrolling the grid ( grid_table.py in chapter 14)
>> using the scrollbars I found that the row and column headers did not
>> scroll with the table!
>> I found that if I forced an update by resizing the window header  
>> would
>> be redrawn properly... It appears that the row/column headers are not
>> being properly updated when the scrollbars are used.
>> Using the "arrow" keys does cause the row/column heads to be properly
>> updated.
>> The examples *did* work on my linux box.
>> Is this a known problem?
>
> Yes.  I thought it was fixed already, but I see that it is still  
> happening in my local workspace.  I'll look into it again.
>
> BTW, you can workaround this in the meantime by forcing a cell  
> editor to be created, because once the grid has a child window then  
> the optimization that causes this problem is not used.  Something  
> like this:
>
> 	grid.EnableCellEditControl()
> 	grid.DisableCellEditControl()
>

I don't seem to be able to create the editor ( probably because it
is all new to me).

I *can* click in a cell and then scrolling works properly. I tried this
but I don't get the cell editor ;(

class TestFrame(wx.Frame):
     def __init__(self):
         wx.Frame.__init__(self, None, title="Grid Table",
                           size=(640,480))

         grid = wx.grid.Grid(self)

         table = TestTable()
         grid.SetTable(table, True)
         grid.SelectBlock(0,0,0,0)
         grid.SetGridCursor(0,0)
         grid.EnableCellEditControl(True)
         grid.DisableCellEditControl()

wIA does not give much info on the parameters to  
Enable.CellEditControl...

Thanks




More information about the wxpython-users mailing list