• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python wx.version函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: OnInit

 def OnInit(self):    
     print wx.version()
     
     frame = ExplorerFrame(None)
     self.SetTopWindow(frame)
     frame.Show()
     return True
开发者ID:TimothyZhang,项目名称:structer,代码行数:7,代码来源:main.py


示例2: CreatePopupMenu

    def CreatePopupMenu(self):
        """
        Overrides method in parent class to provide a Popup Menu
        when the user clicks on MyData's system tray (or menubar) icon.
        """
        self.menu = wx.Menu()

        self.myTardisSyncMenuItem = wx.MenuItem(
            self.menu, wx.NewId(), "MyTardis Sync")
        if wx.version().startswith("3.0.3.dev"):
            self.menu.Append(self.myTardisSyncMenuItem)
        else:
            self.menu.AppendItem(self.myTardisSyncMenuItem)
        self.Bind(wx.EVT_MENU, self.OnMyTardisSync,
                  self.myTardisSyncMenuItem, self.myTardisSyncMenuItem.GetId())

        self.menu.AppendSeparator()

        self.myTardisMainWindowMenuItem = wx.MenuItem(
            self.menu, wx.NewId(), "MyData Main Window")
        if wx.version().startswith("3.0.3.dev"):
            self.menu.Append(self.myTardisMainWindowMenuItem)
        else:
            self.menu.AppendItem(self.myTardisMainWindowMenuItem)
        self.Bind(wx.EVT_MENU, self.OnMyDataMainWindow,
                  self.myTardisMainWindowMenuItem)

        self.myTardisSettingsMenuItem = wx.MenuItem(
            self.menu, wx.NewId(), "MyData Settings")
        if wx.version().startswith("3.0.3.dev"):
            self.menu.Append(self.myTardisSettingsMenuItem)
        else:
            self.menu.AppendItem(self.myTardisSettingsMenuItem)
        self.Bind(wx.EVT_MENU, self.OnMyDataSettings,
                  self.myTardisSettingsMenuItem)

        self.menu.AppendSeparator()

        self.myTardisHelpMenuItem = wx.MenuItem(
            self.menu, wx.NewId(), "MyData Help")
        if wx.version().startswith("3.0.3.dev"):
            self.menu.Append(self.myTardisHelpMenuItem)
        else:
            self.menu.AppendItem(self.myTardisHelpMenuItem)
        self.Bind(wx.EVT_MENU, self.OnMyDataHelp, self.myTardisHelpMenuItem)

        self.menu.AppendSeparator()

        self.exitMyDataMenuItem = wx.MenuItem(
            self.menu, wx.NewId(), "Exit MyData")
        if wx.version().startswith("3.0.3.dev"):
            self.menu.Append(self.exitMyDataMenuItem)
        else:
            self.menu.AppendItem(self.exitMyDataMenuItem)
        self.Bind(wx.EVT_MENU, self.OnExit, self.exitMyDataMenuItem)

        return self.menu
开发者ID:nrmay,项目名称:mydata,代码行数:57,代码来源:taskbaricon.py


示例3: __init__

    def __init__(self):
        wx.Frame.__init__(self, parent=None, id=wx.ID_ANY,
                          title='wxPython example', size=(WIDTH, HEIGHT))
        self.browser = None

        # Must ignore X11 errors like 'BadWindow' and others by
        # installing X11 error handlers. This must be done after
        # wx was intialized.
        if LINUX:
            WindowUtils.InstallX11ErrorHandlers()

        global g_count_windows
        g_count_windows += 1

        self.setup_icon()
        self.create_menu()
        self.Bind(wx.EVT_CLOSE, self.OnClose)

        # Set wx.WANTS_CHARS style for the keyboard to work.
        # This style also needs to be set for all parent controls.
        self.browser_panel = wx.Panel(self, style=wx.WANTS_CHARS)
        self.browser_panel.Bind(wx.EVT_SET_FOCUS, self.OnSetFocus)
        self.browser_panel.Bind(wx.EVT_SIZE, self.OnSize)

        if MAC:
            try:
                # noinspection PyUnresolvedReferences
                from AppKit import NSApp
                # Make the content view for the window have a layer.
                # This will make all sub-views have layers. This is
                # necessary to ensure correct layer ordering of all
                # child views and their layers. This fixes Window
                # glitchiness during initial loading on Mac (Issue #371).
                NSApp.windows()[0].contentView().setWantsLayer_(True)
            except ImportError:
                print("[wxpython.py] Warning: PyObjC package is missing, "
                      "cannot fix Issue #371")
                print("[wxpython.py] To install PyObjC type: "
                      "pip install -U pyobjc")

        if LINUX:
            # On Linux must show before embedding browser, so that handle
            # is available (Issue #347).
            self.Show()
            # In wxPython 3.0 and wxPython 4.0 on Linux handle is
            # still not yet available, so must delay embedding browser
            # (Issue #349).
            if wx.version().startswith("3.") or wx.version().startswith("4."):
                wx.CallLater(1000, self.embed_browser)
            else:
                # This works fine in wxPython 2.8 on Linux
                self.embed_browser()
        else:
            self.embed_browser()
            self.Show()
开发者ID:danny2jenny,项目名称:rec-client-python,代码行数:55,代码来源:wxpython.py


示例4: __populate_versions

    def __populate_versions(self, control):
        imageType = 'Pillow'
        try:
            imageVer = Image.PILLOW_VERSION
        except AttributeError:
            imageType = 'PIL'
            imageVer = Image.VERSION

        versions = ('Hardware:\n'
                    '\tProcessor: {}, {} cores\n\n'
                    'Software:\n'
                    '\tOS: {}, {}\n'
                    '\tPython: {}\n'
                    '\tmatplotlib: {}\n'
                    '\tNumPy: {}\n'
                    '\t{}: {}\n'
                    '\tpySerial: {}\n'
                    '\twxPython: {}\n'
                    ).format(platform.processor(), multiprocessing.cpu_count(),
                             platform.platform(), platform.machine(),
                             platform.python_version(),
                             matplotlib.__version__,
                             numpy.version.version,
                             imageType, imageVer,
                             serial.VERSION,
                             wx.version())

        control.SetValue(versions)

        dc = wx.WindowDC(control)
        extent = list(dc.GetMultiLineTextExtent(versions, control.GetFont()))
        extent[0] += wx.SystemSettings.GetMetric(wx.SYS_VSCROLL_X) * 2
        extent[1] += wx.SystemSettings.GetMetric(wx.SYS_HSCROLL_Y) * 2
        control.SetMinSize((extent[0], extent[1]))
        self.Layout()
开发者ID:har5ha,项目名称:RTLSDR-Scanner,代码行数:35,代码来源:dialogs_help.py


示例5: _CreateHtmlContent

  def _CreateHtmlContent(self):
    """Create content for this About Dialog."""
    try:
      self._content_string = open(self._CONTENT_FILENAME).read()
    except IOError:
      raise AboutBoxException('Cannot open or read about box content')

    # Grab SDK version information
    sdk_version = '???'  # default
    sdk_dir = self._preferences[launcher.Preferences.PREF_APPENGINE]
    if sdk_dir:
      sdk_version_file = os.path.join(sdk_dir, 'VERSION')
      try:
        sdk_version = '<br>'.join(open(sdk_version_file).readlines())
      except IOError:
        pass

    # By default, wx.html windows have a white background.  We'd
    # prefer a standard window background color.  Although there is
    # a wx.html.HtmlWindow.SetBackgroundColour() method, it doesn't
    # help us.  The best we can do is set the background from within
    # the html itself.
    bgcolor = '#%02x%02x%02x' % self._background_color[0:3]

    # Replace some strings with dynamically determined information.
    text = self._content_string
    text = text.replace('{background-color}', bgcolor)
    text = text.replace('{launcher-version}', '???')  # TODO(jrg): add a version
    text = text.replace('{python-version}', sys.version.split()[0])
    text = text.replace('{wxpython-version}', wx.version())
    text = text.replace('{sdk-version}', sdk_version)
    self._content_string = text
开发者ID:Dudy,项目名称:google-appengine-wx-launcher,代码行数:32,代码来源:about_box_controller.py


示例6: check_versions

def check_versions():
    print("[wxpython.py] CEF Python {ver}".format(ver=cef.__version__))
    print("[wxpython.py] Python {ver} {arch}".format(
            ver=platform.python_version(), arch=platform.architecture()[0]))
    print("[wxpython.py] wxPython {ver}".format(ver=wx.version()))
    # CEF Python version requirement
    assert cef.__version__ >= "55.3", "CEF Python v55.3+ required to run this"
开发者ID:danny2jenny,项目名称:rec-client-python,代码行数:7,代码来源:wxpython.py


示例7: EnvironmentInfo

def EnvironmentInfo():
	"""
	Returns a string of the systems information.


	**Returns:**

	*  System information string

	**Note:**

	*  from Editra.dev_tool
	"""

	info = list()
	info.append("---- Notes ----")
	info.append("Please provide additional information about the crash here")
	info.extend(["", "", ""])
	info.append("---- System Information ----")
	info.append("Operating System: %s" % wx.GetOsDescription())
	if sys.platform == 'darwin':
		info.append("Mac OSX: %s" % platform.mac_ver()[0])
	info.append("Python Version: %s" % sys.version)
	info.append("wxPython Version: %s" % wx.version())
	info.append("wxPython Info: (%s)" % ", ".join(wx.PlatformInfo))
	info.append("Python Encoding: Default = %s  File = %s" % \
				(sys.getdefaultencoding(), sys.getfilesystemencoding()))
	info.append("wxPython Encoding: %s" % wx.GetDefaultPyEncoding())
	info.append("System Architecture: %s %s" % (platform.architecture()[0], \
												platform.machine()))
	info.append("Byte order: %s" % sys.byteorder)
	info.append("Frozen: %s" % str(getattr(sys, 'frozen', 'False')))
	info.append("---- End System Information ----")

	return os.linesep.join(info)
开发者ID:LeroyGethroeGibbs,项目名称:devsimpy,代码行数:35,代码来源:Utilities.py


示例8: __init__

    def __init__(self, *args, **kwargs):
        wx.Frame.__init__(self, *args, **kwargs)

        # There needs to be an "Images" directory with one or more jpegs in it in the
        # current working directory for this to work.
        self.jpgs = GetJpgList("./Images") # Get all the jpegs in the Images directory.
        self.CurrentJpg = 0

        self.MaxImageSize = 200

        b = wx.Button(self, -1, "Display next")
        b.Bind(wx.EVT_BUTTON, self.DisplayNext)

        # Starting with an EmptyBitmap, the real one will get put there
        # by the call to .DisplayNext().
        if 'phoenix' in wx.version():
            bmp = wx.Bitmap(self.MaxImageSize, self.MaxImageSize)
        else:
            bmp = wx.EmptyBitmap(self.MaxImageSize, self.MaxImageSize)
        self.Image = wx.StaticBitmap(self, -1, bmp)

        self.DisplayNext()

        # Using a Sizer to handle the layout: I never  use absolute positioning.
        box = wx.BoxSizer(wx.VERTICAL)
        box.Add(b, 0, wx.CENTER | wx.ALL, 10)

        # Adding stretchable space before and after centers the image.
        box.Add((1, 1), 1)
        box.Add(self.Image, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALL | wx.ADJUST_MINSIZE, 10)
        box.Add((1, 1), 1)

        self.SetSizerAndFit(box)

        self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
开发者ID:PythonCHB,项目名称:wxPythonDemos,代码行数:35,代码来源:StaticBitmap.py


示例9: software_stack

def software_stack():
    """
    Import all the hard dependencies.
    Returns a dict with the version.
    """
    # Mandatory
    import numpy, scipy

    d = dict(
        numpy=numpy.version.version,
        scipy=scipy.version.version,
    )

    # Optional but strongly suggested.
    try:
        import netCDF4, matplotlib
        d.update(dict(
            netCDF4=netCDF4.getlibversion(),
            matplotlib="Version: %s, backend: %s" % (matplotlib.__version__, matplotlib.get_backend()),
            ))
    except ImportError:
        pass

    # Optional (GUIs).
    try:
        import wx
        d["wx"] = wx.version()
    except ImportError:
        pass

    return d
开发者ID:akakcolin,项目名称:abipy,代码行数:31,代码来源:abilab.py


示例10: CheckForWx

def CheckForWx():
    """Try to import wx module and check its version"""
    if 'wx' in sys.modules.keys():
        return

    minVersion = [2, 8, 10, 1]
    try:
        try:
            import wxversion
        except ImportError as e:
            raise ImportError(e)
        # wxversion.select(str(minVersion[0]) + '.' + str(minVersion[1]))
        wxversion.ensureMinimal(str(minVersion[0]) + '.' + str(minVersion[1]))
        import wx
        version = wx.version().split(' ')[0]

        if map(int, version.split('.')) < minVersion:
            raise ValueError('Your wxPython version is %s.%s.%s.%s' % tuple(version.split('.')))

    except ImportError as e:
        print >> sys.stderr, 'ERROR: wxGUI requires wxPython. %s' % str(e)
        sys.exit(1)
    except (ValueError, wxversion.VersionError) as e:
        print >> sys.stderr, 'ERROR: wxGUI requires wxPython >= %d.%d.%d.%d. ' % tuple(minVersion) + \
            '%s.' % (str(e))
        sys.exit(1)
    except locale.Error as e:
        print >> sys.stderr, "Unable to set locale:", e
        os.environ['LC_ALL'] = ''
开发者ID:caomw,项目名称:grass,代码行数:29,代码来源:globalvar.py


示例11: __init__

 def __init__(self, parent, exception=''):
     wx.Dialog.__init__(self, parent, -1, 'Application Error', style=wx.DEFAULT_DIALOG_STYLE|wx.STAY_ON_TOP)
     
     # get system information
     self.exception = ''
     self.exception += exception
     self.exception += '\n-------------------------'
     self.exception += '\nmMass: %s' % (config.version)
     self.exception += '\nPython: %s' % str(platform.python_version_tuple())
     self.exception += '\nwxPython: %s' % str(wx.version())
     self.exception += '\nNumPy: %s' % str(numpy.version.version)
     self.exception += '\n-------------------------'
     self.exception += '\nArchitecture: %s' % str(platform.architecture())
     self.exception += '\nMachine: %s' % str(platform.machine())
     self.exception += '\nPlatform: %s' % str(platform.platform())
     self.exception += '\nProcessor: %s' % str(platform.processor())
     self.exception += '\nSystem: %s' % str(platform.system())
     self.exception += '\nMac: %s' % str(platform.mac_ver())
     self.exception += '\nMSW: %s' % str(platform.win32_ver())
     self.exception += '\nLinux: %s' % str(platform.dist())
     self.exception += '\n-------------------------\n'
     self.exception += 'Add your comments:\n'
     
     # make GUI
     sizer = self.makeGUI()
     
     # fit layout
     self.Layout()
     sizer.Fit(self)
     self.SetSizer(sizer)
     self.SetMinSize(self.GetSize())
     self.Centre()
开发者ID:jojoelfe,项目名称:mMass_HDX,代码行数:32,代码来源:dlg_error.py


示例12: __init__

    def __init__(self, WindowUtils, OS_PLATFORM, WIDTH=1400, HEIGHT=800):

        wx.Frame.__init__(self, parent=None, id=wx.ID_ANY,
                          title="wxPython example", size=(WIDTH, HEIGHT))
        self.browser = None
        self.WindowUtils = WindowUtils
        self.OS_PLATFORM = OS_PLATFORM

        if OS_PLATFORM == "LINUX":
            self.WindowUtils.InstallX11ErrorHandlers()

        global g_count_windows
        g_count_windows += 1

        self.setup_icon()
        self.create_menu()
        self.Bind(wx.EVT_CLOSE, self.OnClose)

        self.browser_panel = wx.Panel(self, style=wx.WANTS_CHARS)
        self.browser_panel.Bind(wx.EVT_SET_FOCUS, self.OnSetFocus)
        self.browser_panel.Bind(wx.EVT_SIZE, self.OnSize)

        if OS_PLATFORM == "LINUX":
            self.Show()
            if wx.version.startswith("3.") or wx.version().startswith("4."):
                wx.CallLater(20, self.embed_browser)
            else:
                self.embed_browser()
        else:
            self.embed_browser()
            self.Show()
开发者ID:leezxczxc,项目名称:study,代码行数:31,代码来源:MainFrame.py


示例13: GetEnvironmentInfo

    def GetEnvironmentInfo(self):
        """Get the enviromental info / Header of error report
        @return: string

        """
        system_language = wx.Locale.GetLanguageName(wx.Locale.GetSystemLanguage())
        running_language = wx.Locale.GetLanguageName(wx.GetLocale().GetLanguage())
        res = wx.Display().GetGeometry()
        info = list()
        info.append(self.GetProgramName())
        info.append(u"Operating System: %s" % wx.GetOsDescription())
        if sys.platform == 'darwin':
            info.append(u"Mac OSX: %s" % platform.mac_ver()[0])
        info.append(u"System Lanauge: %s" % system_language)
        info.append(u"Running Lanauge: %s" % running_language)
        info.append(u"Screen Resolution: %ix%i" % (res[2], res[3]))
        info.append(u"Python Version: %s" % sys.version)
        info.append(u"wxPython Version: %s" % wx.version())
        info.append(u"wxPython Info: (%s)" % ", ".join(wx.PlatformInfo))
        info.append(u"Python Encoding: Default=%s  File=%s" % \
                    (sys.getdefaultencoding(), sys.getfilesystemencoding()))
        info.append(u"wxPython Encoding: %s" % wx.GetDefaultPyEncoding())
        info.append(u"System Architecture: %s %s" % (platform.architecture()[0], \
                                                    platform.machine()))
        info.append(u"Frozen: %s" % str(getattr(sys, 'frozen', 'False')))
        info.append(u"")
        info.append(u"")

        return info#os.linesep.join(info)
开发者ID:sproaty,项目名称:whyteboard,代码行数:29,代码来源:errdlg.py


示例14: layout_all

 def layout_all(self,dc=None):
     #settingbackgroundcolors
     #background = wx.NamedColour(self.background_color)
     #if self.GetBackgroundColour() != background:
     #   self.SetBackgroundColour(background) 
        #self.Clear()
     #   print 'refreshing'  
     if not dc:
         dc = wx.ClientDC(self)
     if wx.version().startswith('3'):
         self.client_size = self.GetClientSizeTuple()#seb An array doesn't make sense as a truth value: array(self.GetClientSizeTuple())
     else:
         self.client_size = self.GetClientSize()
     # set the device context for all titles so they can
     # calculate their size
     for text_obj in self.all_titles:
         text_obj.set_dc(dc)
         
     graph_area = box_object((0,0),self.client_size)
     graph_area.inflate(.95) # shrink box slightly
     
     # shrink graph area to make room for titles
     graph_area = self.layout_border_text(graph_area)        
     # layout axis and graph data
     graph_area = self.layout_graph(graph_area,dc)
     # center titles around graph area.
     self.finalize_border_text(graph_area,dc)   
     self.graph_box = graph_area
     # clear the dc for all titles
     # ? neccessary ?
     for text_obj in self.all_titles:
         text_obj.clear_dc()
     self.layout_data()
开发者ID:macronucleus,项目名称:Chromagnon,代码行数:33,代码来源:wxplt.py


示例15: format_popup

 def format_popup(self,pos):
     menu = wx.Menu()
     menu.Append(505, 'previous zoom', 'previous zoom')
     menu.Enable(505, len(self.zoom_hist) and self.zoom_hist_i>0)
     menu.Append(500, 'Auto Zoom', 'Auto Zoom')
     menu.Append(506, 'next zoom', 'next zoom')
     menu.Enable(506, len(self.zoom_hist) and self.zoom_hist_i<len(self.zoom_hist)-1)
     menu.Append(507, 'clear zoom history', 'clear zoom history')
     menu.Append(501, 'X-Y equal aspect ratio', 'X-Y equal - set aspect ratio to 1')
     menu.Append(502, 'X-Y any aspect ratio', 'X-Y equal - set aspect ratio to "normal"')
     menu.Append(503, 'make X-Y axes a tight fit', 'fit X-Y axes to a fraction of the grid spacing"')
     menu.Append(504, 'freeze X-Y axes bounds', 'freeze X-Y axes grid"')
     self.Bind(wx.EVT_MENU, self.on_prev_zoom, id=505)
     self.Bind(wx.EVT_MENU, self.on_next_zoom, id=506)
     self.Bind(wx.EVT_MENU, self.on_zoom_forget, id=507)
     self.Bind(wx.EVT_MENU, self.on_auto_zoom, id=500)
     self.Bind(wx.EVT_MENU, self.on_equal_aspect_ratio, id=501)
     self.Bind(wx.EVT_MENU, self.on_any_aspect_ratio, id=502)
     self.Bind(wx.EVT_MENU, self.on_axis_tight, id=503)
     self.Bind(wx.EVT_MENU, self.on_axis_freeze, id=504)
     #20090603 (called by default) menu.UpdateUI()
     if wx.version().startswith('3'):
         self.PopupMenuXY(menu) #20090603 (default mouse cursor pos) ,pos[0],pos[1])
     else:
         self.PopupMenu(menu)
开发者ID:macronucleus,项目名称:Chromagnon,代码行数:25,代码来源:wxplt.py


示例16: create_versions_message

def create_versions_message():
    return "\n".join([
        "Timeline version: %s" % get_full_version(),
        "System version: %s" % ", ".join(platform.uname()),
        "Python version: %s" % python_version.replace("\n", ""),
        "wxPython version: %s" % wx.version(),
    ])
开发者ID:ncqgm,项目名称:gnumed,代码行数:7,代码来源:setup.py


示例17: wxVerCheck

def wxVerCheck(self,VerbosityLevel=0):
    """VerbosityLevel (0=OFF) (!0=ON)"""
    try:
        import wx
        minVer = [2,8,9]
        ver = wx.version()
        p = re.compile(r'[.]+')
        m = p.split( ver )
        n = [int(m[0]),int(m[1]),int(m[2])]
        if n < minVer:
            generate_except
    except:
        # use TK for questions        
        response = askquestion('Error', 'wxPython upgrade required. \nDo you want to install now?')
        if response == "yes":
            folder = _os.path.abspath("..\..\..\utilities\python")
            cmd = "%s\checkAndinstall.py --wxPython --path=%s" %(folder,folder)
            stat = _os.system(cmd)
            response = showwarning('Restart', "You must now restart script")
        else:
            print" wxPython must be installed/upgraded in order to use run this script"
            print" See www.wxPython.org"
        print
        return _FAIL
            
    return _SUCCESS
开发者ID:robert-budde,项目名称:vorwerk-tm5-oss-sources,代码行数:26,代码来源:wxCheck.py


示例18: main

def main():
    load_plugins()
    global app
    print "(2) wxPython version %s" % wx.version()
    #create the mandatory wx application object
    if config.isMac():
        import tc_mac
        app = tc_mac.App(redirect=False)
    else:
        app = wx.App(redirect=False)
    
    #test for availability of our listening port
    interface = config.get("client", "listen_interface")
    port = config.getint("client", "listen_port")
    print "(1) opening TorChat listener on %s:%s" % (interface, port)
    listen_socket = tc_client.tryBindPort(interface, port)
    if not listen_socket:
        print "(1) opening TorChat listener on %s, any port" % interface
        listen_socket = tc_client.tryBindPort(interface, 0)
    if not listen_socket:
        print "(1) %s:%s is already in use" % (interface, port)
        wx.MessageBox(tc_gui.lang.D_WARN_USED_PORT_MESSAGE % (interface, port),
                      tc_gui.lang.D_WARN_USED_PORT_TITLE)
        return
    else:
        print "(1) TorChat is listening on %s:%s" % (interface, port)
    
    #now continue with normal program startup 
    print "(1) start initializing main window"
    app.mw = tc_gui.MainWindow(listen_socket)
    app.SetTopWindow(app.mw)
    print "(1) main window initialized"
    print "(1) entering main loop"
    app.MainLoop()
开发者ID:bit-fag,项目名称:TorChat,代码行数:34,代码来源:torchat.py


示例19: after_show

    def after_show(self):
        from . import signal
        from .. import cli
        sys.excepthook = excepthook

        # Process options
        cli.BumpsOpts.FLAGS |= set(('inspect','syspath'))
        opts = cli.getopts()

        # For wx debugging, load the wxPython Widget Inspection Tool if requested.
        # It will cause a separate interactive debugger window to be displayed.
        if opts.inspect: inspect()

        if opts.syspath:
            print("*** Resource directory:  "+resource_dir())
            print("*** Python path is:")
            for i, p in enumerate(sys.path):
                print("%5d  %s" %(i, p))

        # Put up the initial model
        model,output = initial_model(opts)
        if not model: model = plugin.new_model()
        signal.log_message(message=output)
        #self.frame.panel.show_view('log')
        self.frame.panel.set_model(model=model)

        # When setting initial aui panel split:
        #     mac layout fails if frame is already shown
        #     windows/unix layout fails if frame is not shown
        isMac = "cocoa" in wx.version()
        if not isMac: self.frame.Show()
        self.frame.panel.Layout()
        self.frame.panel.aui.Split(0, wx.TOP)
        if isMac: self.frame.Show()
开发者ID:HMP1,项目名称:bumps,代码行数:34,代码来源:gui_app.py


示例20: clone_key_event

 def clone_key_event(self, event):
     if wx.version().split('.')[:2] > ['2', '8']:
         evt = MyKeyEvent()
         evt.altDown = event.altDown
         evt.controlDown = event.controlDown
         evt.KeyCode = event.KeyCode
         evt.metaDown = event.metaDown
         if wx.Platform == '__WXMSW__':
             evt.RawKeyCode = event.RawKeyCode
             evt.RawKeyFlags = event.RawKeyFlags
         #evt.m_scanCode = event.m_scanCode
         evt.shiftDown = event.shiftDown
         evt.X = event.X
         evt.Y = event.Y
     else:
         evt = wx.KeyEvent()
         evt.m_altDown = event.m_altDown
         evt.m_controlDown = event.m_controlDown
         evt.m_keyCode = event.m_keyCode
         evt.m_metaDown = event.m_metaDown
         if wx.Platform == '__WXMSW__':
             evt.m_rawCode = event.m_rawCode
             evt.m_rawFlags = event.m_rawFlags
         #evt.m_scanCode = event.m_scanCode
         evt.m_shiftDown = event.m_shiftDown
         evt.m_x = event.m_x
         evt.m_y = event.m_y
         evt.SetEventType(event.GetEventType())
         evt.SetId(event.GetId())
     return evt
开发者ID:LinYuanLab,项目名称:ulipad,代码行数:30,代码来源:Editor.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python delayedresult.startWorker函数代码示例发布时间:2022-05-26
下一篇:
Python models.User类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap