Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我将如何更改现有的 WXPython 对话框?例如,假设我想在wx.dirDialog. 我知道我需要对它进行子类化,但是如何在保持现有功能不变的同时添加控件(如文本框或复选框)?
wx.dirDialog
这应该是不言自明的:
class SubclassDialog(wx.Dialog): def __init__(self): wx.Dialog.__init__(self, None, -1, 'Subclass', size=(150, 100)) self.Centre() okButton = wx.Button(self, wx.ID_OK, "OK", pos=(25, 40)) okButton.SetDefault() textbox = wx.TextCtrl(self, pos=(20,15))