且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

实现“另存为"在保存对话框 wxpython

更新时间:2023-02-08 09:29:44

您使用了错误的对话框类型.使用 FileDialog 代替:

You're using the wrong dialog type. Use FileDialog instead:

  • 它已经包含文件将被覆盖时提示确认"功能,带有 wx.FD_OVERWRITE_PROMPT
  • 这就是其他人使用的,所以用户会期待这种对话,而当他们得到其他东西时会感到困惑

我找不到在对话框中用另存为"替换保存"的方法(它只有 wx.FD_SAVE),但大多数人不会注意到这一点.

I couldn't find a way to replace "Save" with "Save as" in the dialog (it just has wx.FD_SAVE) but most people won't notice that.