当前位置: 首页>>代码示例>>Python>>正文


Python wx.__version__方法代码示例

本文整理汇总了Python中wx.__version__方法的典型用法代码示例。如果您正苦于以下问题:Python wx.__version__方法的具体用法?Python wx.__version__怎么用?Python wx.__version__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在wx的用法示例。


在下文中一共展示了wx.__version__方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import __version__ [as 别名]
def __init__(self,  parent):
        global delete_before_connect
        import wx
        RoundTrackDlg.RoundTrackDlg.__init__(self, parent)
        #self.GetSizer().Fit(self)
        self.SetMinSize(self.GetSize())
        self.m_buttonDelete.Bind(wx.EVT_BUTTON, self.onDeleteClick)
        self.m_buttonReconnect.Bind(wx.EVT_BUTTON, self.onConnectClick)
        if wx.__version__ < '4.0':
            self.m_buttonReconnect.SetToolTipString( u"Select two converging Tracks to re-connect them\nor Select tracks including one round corner to be straighten" )
            self.m_buttonRound.SetToolTipString( u"Select two connected Tracks to round the corner\nThen choose distance from intersection and the number of segments" )
        else:
            self.m_buttonReconnect.SetToolTip( u"Select two converging Tracks to re-connect them\nor Select tracks including one round corner to be straighten" )
            self.m_buttonRound.SetToolTip( u"Select two connected Tracks to round the corner\nThen choose distance from intersection and the number of segments" )
        if self.m_checkBoxDelete.IsChecked():
            delete_before_connect = True
            
# 
开发者ID:easyw,项目名称:RF-tools-KiCAD,代码行数:20,代码来源:round_trk.py

示例2: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import __version__ [as 别名]
def __init__(self, canvas, legend):
        NavigationToolbar2Wx.__init__(self, canvas)
        self._canvas = canvas
        self._legend = legend
        self._autoScale = True

        if matplotlib.__version__ >= '1.2':
            panId = self.wx_ids['Pan']
        else:
            panId = self.FindById(self._NTB2_PAN).GetId()
        self.ToggleTool(panId, True)
        self.pan()

        checkLegend = wx.CheckBox(self, label='Legend')
        checkLegend.SetValue(legend.get_visible())
        self.AddControl(checkLegend)
        self.Bind(wx.EVT_CHECKBOX, self.__on_legend, checkLegend, id)

        if wx.__version__ >= '2.9.1':
            self.AddStretchableSpace()
        else:
            self.AddSeparator()

        self._textCursor = wx.StaticText(self, style=wx.ALL | wx.ALIGN_RIGHT)
        font = self._textCursor.GetFont()
        if wx.__version__ >= '2.9.1':
            font.MakeSmaller()
        font.SetFamily(wx.FONTFAMILY_TELETYPE)
        self._textCursor.SetFont(font)
        w, _h = get_text_size(' ' * 18, font)
        self._textCursor.SetSize((w, -1))

        self.AddControl(self._textCursor)

        self.Realize() 
开发者ID:EarToEarOak,项目名称:RF-Monitor,代码行数:37,代码来源:navigation_toolbar.py

示例3: enable_wx

# 需要导入模块: import wx [as 别名]
# 或者: from wx import __version__ [as 别名]
def enable_wx(self, app=None):
        """Enable event loop integration with wxPython.

        Parameters
        ----------
        app : WX Application, optional.
            Running application to use.  If not given, we probe WX for an
            existing application object, and create a new one if none is found.

        Notes
        -----
        This methods sets the ``PyOS_InputHook`` for wxPython, which allows
        the wxPython to integrate with terminal based applications like
        IPython.

        If ``app`` is not given we probe for an existing one, and return it if
        found.  If no existing app is found, we create an :class:`wx.App` as
        follows::

            import wx
            app = wx.App(redirect=False, clearSigInt=False)
        """
        import wx
        
        wx_version = V(wx.__version__).version
        
        if wx_version < [2, 8]:
            raise ValueError("requires wxPython >= 2.8, but you have %s" % wx.__version__)
        
        from IPython.lib.inputhookwx import inputhook_wx
        self.set_inputhook(inputhook_wx)
        self._current_gui = GUI_WX
        import wx
        if app is None:
            app = wx.GetApp()
        if app is None:
            app = wx.App(redirect=False, clearSigInt=False)
        app._in_event_loop = True
        self._apps[GUI_WX] = app
        return app 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:42,代码来源:inputhook.py

示例4: enable_wx

# 需要导入模块: import wx [as 别名]
# 或者: from wx import __version__ [as 别名]
def enable_wx(self, app=None):
        """Enable event loop integration with wxPython.

        Parameters
        ----------
        app : WX Application, optional.
            Running application to use.  If not given, we probe WX for an
            existing application object, and create a new one if none is found.

        Notes
        -----
        This methods sets the ``PyOS_InputHook`` for wxPython, which allows
        the wxPython to integrate with terminal based applications like
        IPython.

        If ``app`` is not given we probe for an existing one, and return it if
        found.  If no existing app is found, we create an :class:`wx.App` as
        follows::

            import wx
            app = wx.App(redirect=False, clearSigInt=False)
        """
        import wx
        from distutils.version import LooseVersion as V
        wx_version = V(wx.__version__).version  # @UndefinedVariable

        if wx_version < [2, 8]:
            raise ValueError("requires wxPython >= 2.8, but you have %s" % wx.__version__)  # @UndefinedVariable

        from pydev_ipython.inputhookwx import inputhook_wx
        self.set_inputhook(inputhook_wx)
        self._current_gui = GUI_WX

        if app is None:
            app = wx.GetApp()  # @UndefinedVariable
        if app is None:
            app = wx.App(redirect=False, clearSigInt=False)  # @UndefinedVariable
        app._in_event_loop = True
        self._apps[GUI_WX] = app
        return app 
开发者ID:fabioz,项目名称:PyDev.Debugger,代码行数:42,代码来源:inputhook.py

示例5: show_versions

# 需要导入模块: import wx [as 别名]
# 或者: from wx import __version__ [as 别名]
def show_versions():
	""" Shows installed version numbers """
	print('Packages required for GUI: (this displays currently installed version numbers)')
	print('\tElecSus: ', __version__)
	print('\tWxPython: ', wx.__version__)
	print('\tNumpy: ', np.__version__)
	print('\tMatplotlib: ', mpl.__version__)
	print('Required for fitting (in addition to above):')
	print('\tScipy: ', sp.__version__)
	print('\tPSUtil: ', psutil.__version__)
	print('\tLMfit: ', lm.__version__) 
开发者ID:jameskeaveney,项目名称:ElecSus,代码行数:13,代码来源:elecsus_gui.py

示例6: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import __version__ [as 别名]
def __init__(self, parent, mainwin, ID):
		""" mainwin is the main panel so we can bind buttons to actions in the main frame """
		wx.Panel.__init__(self, parent, id=-1)
				
		self.fig = plt.figure(ID,facecolor=(240./255,240./255,240./255),figsize=(12.9,9.75),dpi=80)
		
		#self.ax = self.fig.add_subplot(111)
		
		# create the wx objects to hold the figure
		self.canvas = FigureCanvasWxAgg(self, -1, self.fig)
		self.toolbar = Toolbar(self.canvas) #matplotlib toolbar (pan, zoom, save etc)
		#self.toolbar.Realize()
		
		# Create vertical sizer to hold figure and toolbar - dynamically expand with window size
		plot_sizer = wx.BoxSizer(wx.VERTICAL)
		plot_sizer.Add(self.canvas, 1, flag = wx.EXPAND|wx.ALL) #wx.TOP|wx.LEFT|wx.GROW)
		plot_sizer.Add(self.toolbar, 0, wx.EXPAND)

		mainwin.figs.append(self.fig)
		mainwin.fig_IDs.append(ID) # use an ID number to keep track of figures
		mainwin.canvases.append(self.canvas)

		# display some text in the middle of the window to begin with
		self.fig.text(0.5,0.5,'ElecSus GUI\n\nVersion '+__version__+'\n\nTo get started, use the panel on the right\nto either Compute a spectrum or Import some data...', ha='center',va='center')
		#self.fig.hold(False)
		
		self.SetSizer(plot_sizer)
		#self.Layout() #Fit() 
开发者ID:jameskeaveney,项目名称:ElecSus,代码行数:30,代码来源:elecsus_gui.py

示例7: init_stage2

# 需要导入模块: import wx [as 别名]
# 或者: from wx import __version__ [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() 
开发者ID:wxGlade,项目名称:wxGlade,代码行数:42,代码来源:wxglade.py

示例8: SetSizeHints

# 需要导入模块: import wx [as 别名]
# 或者: from wx import __version__ [as 别名]
def SetSizeHints(self, sz1, sz2):
        if wx.__version__ < '4.0':
            self.SetSizeHintsSz(sz1, sz2)
        else:
            super(RoundTrack_Dlg, self).SetSizeHints(sz1, sz2) 
开发者ID:easyw,项目名称:RF-tools-KiCAD,代码行数:7,代码来源:round_trk.py


注:本文中的wx.__version__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。