WxPython:符合Ok / Cancel按钮顺序的跨平台方法 [英] WxPython: Cross-Platform Way to Conform Ok/Cancel Button Order

查看:86
本文介绍了WxPython:符合Ok / Cancel按钮顺序的跨平台方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习wxPython,所以大多数库和类对我来说都是新的。

I'm learning wxPython so most of the libraries and classes are new to me.

我正在创建首选项对话框类,但最不了解确保确定/取消(或保存/关闭)按钮在平台上的正确顺序的方法。该程序旨在在GNOME和Windows上运行,因此我想确保按钮在每个平台上的顺序正确。

I'm creating a Preferences dialog class but don't know the best way to make sure the OK/Cancel (or Save/Close) buttons are in the correct order for the platform. This program is intended to run both on GNOME and Windows, so I want to make sure that the buttons are in the correct order for each platform.

wxPython是否提供了可实现以下功能的功能:阻止我执行 if platform.system()=='Linux'那样的黑客行为?

Does wxPython provide functionality that prevents me from doing a if platform.system() == 'Linux' kind of hack?

推荐答案

仅当您使用常规对话框(如wx.FileDialog)时,对话框的外观才能更改,如果您自己创建布局,则在每个平台上都将保持不变。

The appearance of a dialog can change only if you use stock dialogs (like wx.FileDialog), if you make your own the layout will stay the same on every platform.

wx.Dialog有一个CreateStdDialogBu​​ttonSizer方法,该方法使用标准按钮创建一个wx.StdDialogBu​​ttonSizer,您可能会在不同平台上看到布局差异,但不必使用它。

wx.Dialog has a CreateStdDialogButtonSizer method that creates a wx.StdDialogButtonSizer with standard buttons where you might see differences in layout on different platforms but you don't have to use that.

这篇关于WxPython:符合Ok / Cancel按钮顺序的跨平台方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆