All pastes #674497 Raw Edit

Someone

public text v1 · immutable
#674497 ·published 2007-08-29 09:30 UTC
rendered paste body
import wx

class MainWindow(wx.Frame):
    """ We simply derive a new class of Frame. """
    def __init__(self, parent, id, title):
        wx.Frame.__init__(self, parent, id, title, size=(640,480))

        self.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown)
        
        self.control = wx.TextCtrl(self, 1, style=wx.TE_MULTILINE)
        self.CreateStatusBar()
        self.Show(True)
    
    def OnKeyDown(self, event):
        if event.GetKeyCode() == wx.WXK_CONTROL:
            self.control.AppendText('control')

app = wx.PySimpleApp()
frame=MainWindow(None, wx.ID_ANY, 'Small editor')
app.MainLoop()