1

この wxpython アプリを Windows 7 で実行しています。何らかの理由ctrl+xでキーボードを押しても、フレームが閉じません。

ただし、バインドをtext='quit\tCtrl+x'からtext='quit\tCtrl+q'または 以外の文字に変更するxと、フレームが閉じます。

ctrl+xフレームが閉じられないようにしているwxpythonに特別な意味がありますか?

import os
import wx
class MainMe(wx.Frame):
    def __init__(self):
        wx.Frame.__init__(self, parent=None, size=(300, 300), title = 'test frame')
        wx.TextCtrl(parent=self, style =wx.TE_MULTILINE | wx.TE_NO_VSCROLL)
        self.CreateStatusBar()

        filemenu = wx.Menu()

        exitId, aboutId = wx.NewId(), wx.NewId()
        menuAbout = filemenu.Append(id=aboutId, text='about\tCtrl+a', help='more information')
        menuExit = filemenu.Append(id=exitId, text='quit\tCtrl+x', help="close")

        menubar = wx.MenuBar()
        menubar.Append(filemenu, title='File')
        self.SetMenuBar(menubar)

        self.Bind(wx.EVT_MENU, self.onAbout, source=menuAbout)
        self.Bind(wx.EVT_MENU, self.onExit, source=menuExit)

        self.Show()

    def onAbout(self, e):
        dlg = wx.MessageDialog( self, "A small text editor", "About Sample Editor", wx.OK)
        dlg.ShowModal()
        dlg.Destroy()

    def onExit(self, e):
        self.Close(True)

a = wx.App()
f = MainMe()
a.MainLoop()
4

1 に答える 1