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


Python wx.App方法代码示例

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


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

示例1: main

# 需要导入模块: import wx [as 别名]
# 或者: from wx import App [as 别名]
def main():
    device = cv2.CAP_OPENNI
    capture = cv2.VideoCapture(device)
    if not(capture.isOpened()):
        capture.open(device)

    capture.set(cv2.CAP_PROP_FRAME_WIDTH, 640)
    capture.set(cv2.CAP_PROP_FRAME_HEIGHT, 480)

    app = wx.App()
    frame = MyFrame(None, -1, 'chapter2.py', capture)
    frame.Show(True)
#   self.SetTopWindow(frame)
    app.MainLoop()

    # When everything done, release the capture
    capture.release()
    cv2.destroyAllWindows() 
开发者ID:PacktPublishing,项目名称:OpenCV-Computer-Vision-Projects-with-Python,代码行数:20,代码来源:chapter2.py

示例2: main

# 需要导入模块: import wx [as 别名]
# 或者: from wx import App [as 别名]
def main():
    args = parse_args(sys.argv[1:])

    # set logging level
    if args.verbose > 1:
        set_log_debug()
    elif args.verbose == 1:
        set_log_info()

    app = wx.App()
    frm = MainFrame(
        args.IMAGE, args.INTERFACE, args.SERVER, args.TITLE,
        None, title='wifi-survey: %s' % args.TITLE
    )
    frm.Show()
    frm.Maximize(True)
    frm.SetStatusText('%s' % frm.pnl.GetSize())
    app.MainLoop() 
开发者ID:jantman,项目名称:python-wifi-survey-heatmap,代码行数:20,代码来源:ui.py

示例3: _build_menu_bar

# 需要导入模块: import wx [as 别名]
# 或者: from wx import App [as 别名]
def _build_menu_bar(self):
        self.menuBar = wx.MenuBar()

        # File menu
        file_menu = wx.Menu()
        wx.App.SetMacExitMenuItemId(wx.ID_EXIT)
        exit_item = file_menu.Append(wx.ID_EXIT, "E&xit\tCtrl-Q", "Exit NodeMCU PyFlasher")
        exit_item.SetBitmap(images.Exit.GetBitmap())
        self.Bind(wx.EVT_MENU, self._on_exit_app, exit_item)
        self.menuBar.Append(file_menu, "&File")

        # Help menu
        help_menu = wx.Menu()
        help_item = help_menu.Append(wx.ID_ABOUT, '&About NodeMCU PyFlasher', 'About')
        self.Bind(wx.EVT_MENU, self._on_help_about, help_item)
        self.menuBar.Append(help_menu, '&Help')

        self.SetMenuBar(self.menuBar) 
开发者ID:marcelstoer,项目名称:nodemcu-pyflasher,代码行数:20,代码来源:Main.py

示例4: GUI

# 需要导入模块: import wx [as 别名]
# 或者: from wx import App [as 别名]
def GUI():
    wx_app = wx.App(redirect=True) # redirect in wxpython 3.0 defaults to False
    #wx_app = wx.App(redirect=False)
    #YamledWindow(content='../workbench/x.yaml')
    #YamledWindow(content='../workbench/y.yaml')
    #YamledWindow(content='../workbench/_yamled_dies.yaml')
    #YamledWindow(content='../workbench/yamled/sample-1.yaml')
    #YamledWindow(content='../workbench/yamled/pt.yaml')
    #YamledWindow(content=yaml_load(open('../workbench/yamled/burp-state-1-report.yaml').read(), yaml.SafeLoader, UnsortableOrderedDict))
    #YamledWindow(content='../workbench/yamled/asdf.yaml')
    #YamledWindow(content='../workbench/yamled/asdfgh.yaml')
    #YamledWindow(content='../workbench/yamled/burp-state-1-report.yaml')
    #YamledWindow(content='../workbench/yamled/_export_webinspect.yaml')
    #YamledWindow(content='../workbench/yamled/midsized.yaml')
    YamledWindow()
    #YamledWindow(content='../workbench/xss-2-intruder-items.yaml')
    wx_app.MainLoop() 
开发者ID:hvqzao,项目名称:report-ng,代码行数:19,代码来源:yamled.py

示例5: wxPythonApp

# 需要导入模块: import wx [as 别名]
# 或者: from wx import App [as 别名]
def wxPythonApp():
    import wx
    app = wx.App()
    frame = wx.Frame(None, -1, "wxPython GUI", size=(200,150))
    frame.SetBackgroundColour('white')
    frame.CreateStatusBar()
    menu= wx.Menu()
    menu.Append(wx.ID_ABOUT, "About", "wxPython GUI")
    menuBar = wx.MenuBar()
    menuBar.Append(menu,"File") 
    frame.SetMenuBar(menuBar)     
    frame.Show()
    
    runT = Thread(target=app.MainLoop)
    runT.setDaemon(True)    
    runT.start()
    print(runT)
    print('createThread():', runT.isAlive()) 
开发者ID:PacktPublishing,项目名称:Python-GUI-Programming-Cookbook-Second-Edition,代码行数:20,代码来源:Control_Frameworks.py

示例6: tray_loop

# 需要导入模块: import wx [as 别名]
# 或者: from wx import App [as 别名]
def tray_loop():
    """Runs the tray applet."""
    if not os.path.isdir(sp_paths.PROFILES_PATH):
        os.mkdir(sp_paths.PROFILES_PATH)
    if "wx" in sys.modules:
        app = App(False)
        app.MainLoop()
    else:
        print("ERROR: Module 'wx' import has failed. Is it installed? \
GUI unavailable, exiting.")
        sp_logging.G_LOGGER.error("ERROR: Module 'wx' import has failed. Is it installed? \
GUI unavailable, exiting.")
        exit()



# Tray applet definitions 
开发者ID:hhannine,项目名称:superpaper,代码行数:19,代码来源:tray.py

示例7: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import App [as 别名]
def __init__(self):
        super().__init__(parent=None,
                         title='Sample App',
                         size=(300, 300))

        # Set up the first Panel to be at position 1, 1
        # and of size 300 by 100 with a blue background
        self.panel1 = wx.Panel(self)
        self.panel1.SetSize(300, 100)
        self.panel1.SetBackgroundColour(wx.Colour(0, 0, 255))

        # Set up the second Panel to be at position 1, 110
        # and of size 300 by 100 with a red background
        self.panel2 = wx.Panel(self)
        self.panel2.SetSize(1, 110, 300, 100)
        self.panel2.SetBackgroundColour(wx.Colour(255, 0, 0)) 
开发者ID:johnehunt,项目名称:advancedpython3,代码行数:18,代码来源:FrameAndPanelApp.py

示例8: attemptLogin

# 需要导入模块: import wx [as 别名]
# 或者: from wx import App [as 别名]
def attemptLogin (self, event):
		usr = self.userName.GetValue()
		passwd = self.passwd.GetValue()
		c = conn.cursor()
		c.execute("select id, access FROM users WHERE username = '%s' AND password = '%s'" % (usr, passwd))
		r = c.fetchone()
		if r is None:
			#print("Invalid Username and Password")
			self.userName.SetValue("")
			self.passwd.SetValue("")
		else:
			self.Close()
			
			# app = wx.App()
			mainInterface(None, r['access'], r['id']).Show()
			# app.MainLoop()
			print('else closed') 
开发者ID:104H,项目名称:HH---POS-Accounting-and-ERP-Software,代码行数:19,代码来源:loginScreen.py

示例9: attemptLogin

# 需要导入模块: import wx [as 别名]
# 或者: from wx import App [as 别名]
def attemptLogin (self, event):
		usr = self.userName.GetValue()
		passwd = self.passwd.GetValue()
		c = conn.cursor()
		c.execute("select id, access FROM users WHERE username = '%s' AND password = '%s'" % (usr, passwd))
		r = c.fetchone()
		if r is None:
			#print("Invalid Username and Password")
			self.userName.SetValue("")
			self.passwd.SetValue("")
		else:
			self.Destroy()
			
			app = wx.App()
			mainInterface(None, r['access'], r['id']).Show()
			app.MainLoop() 
开发者ID:104H,项目名称:HH---POS-Accounting-and-ERP-Software,代码行数:18,代码来源:loginScreen.py

示例10: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import App [as 别名]
def __init__(self):
        try:
            wx.Dialog.EnableLayoutAdaptation(True)
        except AttributeError:
            pass
        wx.App.__init__(self, redirect=False) 
开发者ID:EarToEarOak,项目名称:RF-Monitor,代码行数:8,代码来源:gui.py

示例11: _wx_get_path

# 需要导入模块: import wx [as 别名]
# 或者: from wx import App [as 别名]
def _wx_get_path(self):
        app = wx.App(None)
        style = wx.FD_OPEN | wx.FD_FILE_MUST_EXIST
        dialog = wx.FileDialog(None, self.title, defaultDir=self.start_dir, wildcard='GCode files|*.g;*.gcode;*.nc;*.gc;*.ngc|All Files|*', style=style)
        if dialog.ShowModal() == wx.ID_OK:
            path = dialog.GetPath()
        else:
            path = None
        dialog.Destroy()
        return path 
开发者ID:wolfmanjm,项目名称:kivy-smoothie-host,代码行数:12,代码来源:native_file_chooser.py

示例12: presentation_model

# 需要导入模块: import wx [as 别名]
# 或者: from wx import App [as 别名]
def presentation_model(build_spec):
  app = wx.App(False)
  i18n.load(get_resource_path('languages'), build_spec['language'])
  model = MyModel(build_spec)
  view = MagicMock()
  presentation = Presenter(view, model)
  return presentation 
开发者ID:ME-ICA,项目名称:me-ica,代码行数:9,代码来源:test_presentation.py

示例13: subparser_presentation_model

# 需要导入模块: import wx [as 别名]
# 或者: from wx import App [as 别名]
def subparser_presentation_model(build_spec_subparser):
  app = wx.App(False)
  i18n.load(get_resource_path('languages'), 'english')
  model = MyModel(build_spec_subparser)
  view = MagicMock()
  presentation = Presenter(view, model)
  return presentation




# ----------------------------
#         Tests              #
# ---------------------------- 
开发者ID:ME-ICA,项目名称:me-ica,代码行数:16,代码来源:test_presentation.py

示例14: run

# 需要导入模块: import wx [as 别名]
# 或者: from wx import App [as 别名]
def run(build_spec):
  app = wx.App(False)

  i18n.load(build_spec['language_dir'], build_spec['language'])
  image_repository.patch_images(build_spec['image_dir'])
  controller = Controller(build_spec)
  controller.run()
  app.MainLoop() 
开发者ID:ME-ICA,项目名称:me-ica,代码行数:10,代码来源:application.py

示例15: __init__

# 需要导入模块: import wx [as 别名]
# 或者: from wx import App [as 别名]
def __init__(self, filename = None, ts = False, sp = "", ra = 0):
        app = wx.App()
        frame = MeshViewerFrame(None, -1, 'MeshViewer')
        frame.Show(True)
        app.MainLoop()
        app.Destroy() 
开发者ID:bmershon,项目名称:laplacian-meshes,代码行数:8,代码来源:LapGUI.py


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