wx python 3.0.2 classic禁用的取消按钮wx.progress对话框

2024-09-27 07:26:20 发布

您现在位置:Python中文网/ 问答频道 /正文

我可爱的自定义进度类移到wxpython3的更多问题(请参见第一部分的wx python 3.0.2 classic SetFocus blows

这个:

def setCancel(self, enabled=True):
    cancel = self.dialog.FindWindowById(wx.ID_CANCEL)
    cancel.Enable(enabled)

以前在2.8.12.1 unicode中工作正常,而在3.02中崩溃的原因是:

^{pr2}$

self.dialog^{}。从我在How to override the “Cancel” button event of a ProgressDialog?中读到的

I suspect the native widget won't allow you to access the Cancel button at all, but I'm not sure.

从@RobinDunn的answer到我之前的问题:

On Windows the ProgressDialog [...] has no native window handle, and most non-ProgressDialog-specific APIs like SetFocus will not work.

(重点是我的)

这是否意味着我不能再禁用进度对话框的“取消”按钮?在


Tags: thetoselfnotenabledbuttoncanceldialog

热门问题