Re: Spontaneous closure of the grid cell editor

James Stallings II <[email protected]>
Newsgroups gmane.comp.python.wxpython
Message-ID <CAOaG_2Zwf2W3jF5ysV1Ns-McrRoXfrEU69LNUxDSvReh-MbGmA@mail.gmail.com>
I see one thing right off the bat you should address before pursuing this
further: you are declaring ‘Frame’ as a class you are subclassing from
‘Frame’. Idk if this is having an impact on your specific issue, but I can
say it isn’t proper.

What you should do is give your own extended class a unique name, e.g.:

class newFrameClass(wx.Frame)

I hope this helps :)

best of luck!


On Mon, Jul 13, 2020 at 2:51 AM ioprst <[email protected]> wrote:

> Hey. In wxpython41, I noticed strange mesh behavior when editing cells.
>
> I give a code example.
>
> import wx
> import wx.grid
>
>
> class Frame(wx.Frame):
>
>     def __init__(self, parent):
>         super().__init__(parent)
>
>         vbox = wx.BoxSizer(wx.VERTICAL)
>
>         grid = wx.grid.Grid(self, size=(384, 128))
>         vbox.Add(grid, flag=wx.ALL, border=5)
>
>         vbox.Fit(self)
>         self.SetSizer(vbox)
>         self.Layout()
>
>         grid.CreateGrid(3, 3)
>         table = grid.GetTable()  # type: wx.grid.GridTableBase
>
>         table.SetValue(0, 0, '11')
>         table.SetValue(1, 0, '22')
>
>         grid.SetCellEditor(0, 0, wx.grid.GridCellNumberEditor())
>         grid.SetCellEditor(1, 0, wx.grid.GridCellNumberEditor())
>         grid.SetCellRenderer(0, 0, wx.grid.GridCellNumberRenderer())
>         grid.SetCellRenderer(1, 0, wx.grid.GridCellNumberRenderer())
>
>
> if __name__ == '__main__':
>     app = wx.App()
>     frame = Frame(None)
>     frame.Show()
>     app.MainLoop()
>
> The problem is that I switch to cell editing mode, and then move the
> cursor to the borders of the edited cell, the editor automatically closes.
>
> In previous versions, exit from editing mode occurred only when the editor
> lost focus.
>
> Why is this happening?
>
> WxPython 4.1.0
> Python 3.7.7
> Windows 10
>
> --
> You received this message because you are subscribed to the Google Groups
> "wxPython-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/wxpython-users/5f0b4be0-fd77-46ca-86da-b60d8a56c04fo%40googlegroups.com
> <https://groups.google.com/d/msgid/wxpython-users/5f0b4be0-fd77-46ca-86da-b60d8a56c04fo%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
-- 
ॐ♲ ♥ ☸☮ ☯☰☶☯☮ ☸ ♥ ♲ॐ

-- 
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/CAOaG_2Zwf2W3jF5ysV1Ns-McrRoXfrEU69LNUxDSvReh-MbGmA%40mail.gmail.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.