hello
There's a grid and bunch of other controls in a dialog. When I hit enter to apply changes in a cell, the focus is set to next control. I must use mouse to get back to the grid to make it handle the GRID_CELL_CHANGE event.
This doesn't happen if a frame is used instead of dialog. How can I use enter key when editing cells?
Related (if not the exactly same) problems must have already been solved here, but i just can't find or recognize those threads...
I'm stuck and using wx 2.5.3.1 on Windows 2000.
Thank you in advance!
···
--
Jussi Oksanen
# ---------------------------------------
import wx
import wx.grid
# instead of updating cell content button gets focus when
# hitting enter after editing cell
class MyDialog(wx.Dialog):
def __init__(self, *args, **kwds):
wx.Dialog.__init__(self, None, -1, "My problem", size=(350, 140))
self.grid = wx.grid.Grid(self, -1)
self.button = wx.Button(self, -1, "Why do I get the focus?")
self.grid.CreateGrid(2, 3)
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(self.grid, 1, wx.EXPAND)
sizer.Add(self.button, 0, wx.FIXED_MINSIZE)
self.SetAutoLayout(True)
self.SetSizer(sizer)
self.Layout()
if __name__ == '__main__':
app = wx.PySimpleApp()
dlg = MyDialog()
dlg.Show(True)
app.MainLoop()