I do a project in python-3 and I create a gui with wxpython. In the gui, I use wx.stc.StyledTextCtrl and I wan't that the user won't be able to do undo (Ctrl + Z). There is an option to do that? It is also be awesome if someone knows how to not allow either (Ctrl + V).
Thanks to those who answer!
Here is a basic code of creating a wx.stc.StyledTextCtrl:
import wx
from wx.stc import StyledTextCtrl
app = wx.App()
frame = wx.Frame(None, -1, title='2', pos=(0, 0), size=(500, 500))
frame.Show(True)
messageTxt = StyledTextCtrl(frame, id=wx.ID_ANY, pos=(0, 0), size=(100 * 3, 100),
style=wx.TE_MULTILINE, name="File")
app.SetTopWindow(frame)
app.MainLoop()
Another option is to use stc
's CmdKeyClear
function, which allows stc
to do the work for you.
import wx
from wx.stc import StyledTextCtrl
app = wx.App()
frame = wx.Frame(None, -1, title='2', pos=(0, 0), size=(500, 500))
frame.Show(True)
messageTxt = StyledTextCtrl(frame, id=wx.ID_ANY, pos=(0, 0), size=(100 * 3, 100),
style=wx.TE_MULTILINE, name="File")
messageTxt.CmdKeyClear(ord('V'), wx.stc.STC_SCMOD_CTRL)
messageTxt.CmdKeyClear(ord('Z'), wx.stc.STC_SCMOD_CTRL)
app.SetTopWindow(frame)
app.MainLoop()