本文整理汇总了Python中wxversion.ensureMinimal方法的典型用法代码示例。如果您正苦于以下问题:Python wxversion.ensureMinimal方法的具体用法?Python wxversion.ensureMinimal怎么用?Python wxversion.ensureMinimal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxversion
的用法示例。
在下文中一共展示了wxversion.ensureMinimal方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: init_stage2
# 需要导入模块: import wxversion [as 别名]
# 或者: from wxversion import ensureMinimal [as 别名]
def init_stage2(use_gui):
"""Initialise the remaining (non-path) parts of wxGlade (second stage)
use_gui: Starting wxGlade GUI"""
config.use_gui = use_gui
if use_gui:
# import proper wx-module using wxversion, which is only available in Classic
if compat.IS_CLASSIC:
if not hasattr(sys, "frozen") and 'wx' not in sys.modules:
try:
import wxversion
wxversion.ensureMinimal('2.8')
except ImportError:
msg = _('Please install missing Python module "wxversion".')
logging.error(msg)
sys.exit(msg)
try:
import wx
except ImportError:
msg = _('Please install missing Python module "wxPython".')
logging.error(msg)
sys.exit(msg)
# store current version and platform ('not_set' is default)
config.platform = wx.Platform
config.wx_version = wx.__version__
if sys.platform=="win32":
# register ".wxg" extension
try:
import msw
msw.register_extensions(["wxg"], "wxGlade")
except ImportError:
pass
# codewrites, widgets and sizers are loaded in class main.wxGladeFrame
else:
# use_gui has to be set before importing config
common.init_preferences()
common.init_codegen()