當前位置: 首頁>>代碼示例>>Python>>正文


Python wx.Frame方法代碼示例

本文整理匯總了Python中wx.Frame方法的典型用法代碼示例。如果您正苦於以下問題:Python wx.Frame方法的具體用法?Python wx.Frame怎麽用?Python wx.Frame使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在wx的用法示例。


在下文中一共展示了wx.Frame方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import Frame [as 別名]
def __init__(self, parent, id, title, capture, fps=15):
        # initialize screen capture
        self.capture = capture

        # determine window size and init wx.Frame
        frame,_ = freenect.sync_get_depth()
        self.imgHeight,self.imgWidth = frame.shape[:2]
        buffer = np.zeros((self.imgWidth,self.imgHeight,3),np.uint8)
        self.bmp = wx.BitmapFromBuffer(self.imgWidth, self.imgHeight, buffer)
        wx.Frame.__init__(self, parent, id, title, size=(self.imgWidth, self.imgHeight))

        # set up periodic screen capture
        self.timer = wx.Timer(self)
        self.timer.Start(1000./fps)
        self.Bind(wx.EVT_TIMER, self.NextFrame)
        
        # counteract flicker
        def disable_event(*pargs,**kwargs):
            pass
        self.Bind(wx.EVT_ERASE_BACKGROUND, disable_event)

        # create the layout, which draws all buttons and
        # connects events to class methods
        self.CreateLayout() 
開發者ID:PacktPublishing,項目名稱:OpenCV-Computer-Vision-Projects-with-Python,代碼行數:26,代碼來源:chapter2.py

示例2: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import Frame [as 別名]
def __init__(self, *args, **kwargs):
			self.app = kwargs.pop('app', None)
			wx.Frame.__init__(self, *args, **kwargs)
			# =============== Logging Text Control ================
			self.log_ctrl = log_ctrl(self, style = wx.TE_MULTILINE, add_to_file = True)
			sys.stdout = self.log_ctrl
			sys.stderr = self.log_ctrl
			self.log = wx.LogTextCtrl(self.log_ctrl)
			self.log.SetLogLevel(wx.LOG_Error)
			wx.Log_SetActiveTarget(self.log)
			# =============== player Control ================
			self.player = player_ctrl(self)
			# =============== StatusBar ================
			statusbar = self.CreateStatusBar(2)
			statusbar.SetStatusWidths([-1, -1])
			statusbar.SetStatusText(_('Welcome into application!'), 0)
			# =============== AuiManager ================
			self.aui_manager = AuiManager()
			self.aui_manager.SetManagedWindow(self)
			self.aui_manager.AddPane(self.player, AuiPaneInfo().Name('player').CenterPane())
			self.aui_manager.AddPane(self.log_ctrl, AuiPaneInfo().Name('log_ctrl').Bottom().Layer(0).BestSize((100, 100)).Hide())
			if self.log_ctrl.GetValue() != '':
				self.aui_manager.GetPane('log_ctrl').Show()
			self.aui_manager.Update() 
開發者ID:Wyliodrin,項目名稱:pybass,代碼行數:26,代碼來源:wx_bass_control.py

示例3: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import Frame [as 別名]
def __init__(self, *args, **kwargs):
			self.app = kwargs.pop('app', None)
			wx.Frame.__init__(self, *args, **kwargs)
			# =============== Logging Text Control ================
			self.log_ctrl = log_ctrl(self, style = wx.TE_MULTILINE, add_to_file = True)
			sys.stdout = self.log_ctrl
			sys.stderr = self.log_ctrl
			self.log = wx.LogTextCtrl(self.log_ctrl)
			self.log.SetLogLevel(wx.LOG_Error)
			#~ wx.Log_SetActiveTarget(self.log)
			# =============== player Control ================
			self.player = player_ctrl(self)
			# =============== StatusBar ================
			statusbar = self.CreateStatusBar(2)
			statusbar.SetStatusWidths([-1, -1])
			statusbar.SetStatusText(_('Welcome into application!'), 0)
			# =============== AuiManager ================
			self.aui_manager = AuiManager()
			self.aui_manager.SetManagedWindow(self)
			self.aui_manager.AddPane(self.player, AuiPaneInfo().Name('player').CenterPane())
			self.aui_manager.AddPane(self.log_ctrl, AuiPaneInfo().Name('log_ctrl').Bottom().Layer(0).BestSize((100, 100)).Hide())
			if self.log_ctrl.GetValue() != '':
				self.aui_manager.GetPane('log_ctrl').Show()
			self.aui_manager.Update() 
開發者ID:Wyliodrin,項目名稱:pybass,代碼行數:26,代碼來源:wx_ctrl_phoenix.py

示例4: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import Frame [as 別名]
def __init__(self, layout_type):
    wx.Frame.__init__(self, parent=None, id=-1)

    self.SetDoubleBuffered(True)

    # type of gui to render
    self.layout_type = layout_type

    # Components
    self.icon = None
    self.head_panel = None
    self.config_panel = None
    self.runtime_display = None
    self.foot_panel = None
    self.panels = None

    self._init_properties()
    self._init_components()
    self._do_layout()

    self.Bind(wx.EVT_SIZE, self.onResize)
    self.Bind(wx.EVT_CLOSE, self.onClose) 
開發者ID:ME-ICA,項目名稱:me-ica,代碼行數:24,代碼來源:base_window.py

示例5: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import Frame [as 別名]
def __init__(self):
        wx.Frame.__init__(self, None,
                          pos=wx.DefaultPosition, size=wx.Size(450, 100),
                          style=wx.MINIMIZE_BOX | wx.SYSTEM_MENU | wx.CAPTION |
                          wx.CLOSE_BOX | wx.CLIP_CHILDREN,
                          title="BRUNO")
        panel = wx.Panel(self)

        ico = wx.Icon('boy.ico', wx.BITMAP_TYPE_ICO)
        self.SetIcon(ico)

        my_sizer = wx.BoxSizer(wx.VERTICAL)
        lbl = wx.StaticText(panel,
                            label="Bienvenido Sir. How can I help you?")
        my_sizer.Add(lbl, 0, wx.ALL, 5)
        self.txt = wx.TextCtrl(panel, style=wx.TE_PROCESS_ENTER,
                               size=(400, 30))
        self.txt.SetFocus()
        self.txt.Bind(wx.EVT_TEXT_ENTER, self.OnEnter)
        my_sizer.Add(self.txt, 0, wx.ALL, 5)
        panel.SetSizer(my_sizer)
        self.Show()
        speak.Speak('''Welcome back Sir, Broono at your service.''') 
開發者ID:ab-anand,項目名稱:Bruno,代碼行數:25,代碼來源:daily.py

示例6: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import Frame [as 別名]
def __init__(self, parent, title):
        wx.Frame.__init__(self, parent, -1, title, size=(725, 650),
                          style=wx.DEFAULT_FRAME_STYLE | wx.NO_FULL_REPAINT_ON_RESIZE)
        self._config = FlashConfig.load(self._get_config_file_path())

        self._build_status_bar()
        self._set_icons()
        self._build_menu_bar()
        self._init_ui()

        sys.stdout = RedirectText(self.console_ctrl)

        self.Centre(wx.BOTH)
        self.Show(True)
        print("Connect your device")
        print("\nIf you chose the serial port auto-select feature you might need to ")
        print("turn off Bluetooth") 
開發者ID:marcelstoer,項目名稱:nodemcu-pyflasher,代碼行數:19,代碼來源:Main.py

示例7: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import Frame [as 別名]
def __init__(self, *args, **kwds):
        kwds["style"] = wx.DEFAULT_FRAME_STYLE
        wx.Frame.__init__(self, *args, **kwds)
        
        self.GLinitialized = False
        attribList = (glcanvas.WX_GL_RGBA, # RGBA
                      glcanvas.WX_GL_DOUBLEBUFFER, # Double Buffered
                      glcanvas.WX_GL_DEPTH_SIZE, 24) # 24 bit

        # Create the canvas

        self.canvas = glcanvas.GLCanvas(self, attribList=attribList)

        # Set the event handlers.

        self.canvas.Bind(wx.EVT_ERASE_BACKGROUND, self._doEraseBackground)
        self.canvas.Bind(wx.EVT_SIZE, self._doSize)
        self.canvas.Bind(wx.EVT_PAINT, self._doPaint)

    # Canvas Proxy Methods 
開發者ID:CALFEM,項目名稱:calfem-python,代碼行數:22,代碼來源:classes_wx.py

示例8: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import Frame [as 別名]
def __init__(self, targetfig):
        wx.Frame.__init__(self, None, -1, "Configure subplots")

        toolfig = Figure((6,3))
        canvas = FigureCanvasWx(self, -1, toolfig)

        # Create a figure manager to manage things
        figmgr = FigureManager(canvas, 1, self)

        # Now put all into a sizer
        sizer = wx.BoxSizer(wx.VERTICAL)
        # This way of adding to sizer allows resizing
        sizer.Add(canvas, 1, wx.LEFT|wx.TOP|wx.GROW)
        self.SetSizer(sizer)
        self.Fit()
        tool = SubplotTool(targetfig, toolfig) 
開發者ID:ktraunmueller,項目名稱:Computable,代碼行數:18,代碼來源:backend_wx.py

示例9: configure_subplots

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import Frame [as 別名]
def configure_subplots(self, evt):
        frame = wx.Frame(None, -1, "Configure subplots")

        toolfig = Figure((6,3))
        canvas = self.get_canvas(frame, toolfig)

        # Create a figure manager to manage things
        figmgr = FigureManager(canvas, 1, frame)

        # Now put all into a sizer
        sizer = wx.BoxSizer(wx.VERTICAL)
        # This way of adding to sizer allows resizing
        sizer.Add(canvas, 1, wx.LEFT|wx.TOP|wx.GROW)
        frame.SetSizer(sizer)
        frame.Fit()
        tool = SubplotTool(self.canvas.figure, toolfig)
        frame.Show() 
開發者ID:ktraunmueller,項目名稱:Computable,代碼行數:19,代碼來源:backend_wx.py

示例10: configure_subplots

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import Frame [as 別名]
def configure_subplots(self, evt):
        global FigureManager  # placates pyflakes: created by @_Backend.export
        frame = wx.Frame(None, -1, "Configure subplots")
        _set_frame_icon(frame)

        toolfig = Figure((6, 3))
        canvas = self.get_canvas(frame, toolfig)

        # Create a figure manager to manage things
        FigureManager(canvas, 1, frame)

        # Now put all into a sizer
        sizer = wx.BoxSizer(wx.VERTICAL)
        # This way of adding to sizer allows resizing
        sizer.Add(canvas, 1, wx.LEFT | wx.TOP | wx.GROW)
        frame.SetSizer(sizer)
        frame.Fit()
        SubplotTool(self.canvas.figure, toolfig)
        frame.Show() 
開發者ID:PacktPublishing,項目名稱:Mastering-Elasticsearch-7.0,代碼行數:21,代碼來源:backend_wx.py

示例11: wxPythonApp

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import Frame [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

示例12: OnInit

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import Frame [as 別名]
def OnInit(self):
        frame = wx.Frame(None, -1, "RunDemo: ", pos=(0,0),
                        style=wx.DEFAULT_FRAME_STYLE, name="run a sample")

        menuBar = wx.MenuBar()
        menu = wx.Menu()
        item = menu.Append(wx.ID_EXIT, "E&xit", "Exit demo")
        self.Bind(wx.EVT_MENU, self.OnExitApp, item)
        menuBar.Append(menu, "&File")
        
        frame.SetMenuBar(menuBar)
        frame.Show(True)
        frame.Bind(wx.EVT_CLOSE, self.OnCloseFrame)

        win = runTest(frame)

        # set the frame to a good size for showing the two buttons
        frame.SetSize((200,400))
        win.SetFocus()
        self.window = win
        frect = frame.GetRect()

        self.SetTopWindow(frame)
        self.frame = frame
        return True 
開發者ID:PacktPublishing,項目名稱:Python-GUI-Programming-Cookbook-Second-Edition,代碼行數:27,代碼來源:import_OpenGL_cube_and_cone.py

示例13: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import Frame [as 別名]
def __init__(self, targetfig):
        global FigureManager  # placates pyflakes: created by @_Backend.export
        wx.Frame.__init__(self, None, -1, "Configure subplots")

        toolfig = Figure((6, 3))
        canvas = FigureCanvasWx(self, -1, toolfig)

        # Create a figure manager to manage things
        figmgr = FigureManager(canvas, 1, self)

        # Now put all into a sizer
        sizer = wx.BoxSizer(wx.VERTICAL)
        # This way of adding to sizer allows resizing
        sizer.Add(canvas, 1, wx.LEFT | wx.TOP | wx.GROW)
        self.SetSizer(sizer)
        self.Fit()
        tool = SubplotTool(targetfig, toolfig) 
開發者ID:Relph1119,項目名稱:GraphicDesignPatternByPython,代碼行數:19,代碼來源:backend_wx.py

示例14: configure_subplots

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import Frame [as 別名]
def configure_subplots(self, evt):
        global FigureManager  # placates pyflakes: created by @_Backend.export
        frame = wx.Frame(None, -1, "Configure subplots")
        _set_frame_icon(frame)

        toolfig = Figure((6, 3))
        canvas = self.get_canvas(frame, toolfig)

        # Create a figure manager to manage things
        figmgr = FigureManager(canvas, 1, frame)

        # Now put all into a sizer
        sizer = wx.BoxSizer(wx.VERTICAL)
        # This way of adding to sizer allows resizing
        sizer.Add(canvas, 1, wx.LEFT | wx.TOP | wx.GROW)
        frame.SetSizer(sizer)
        frame.Fit()
        tool = SubplotTool(self.canvas.figure, toolfig)
        frame.Show() 
開發者ID:Relph1119,項目名稱:GraphicDesignPatternByPython,代碼行數:21,代碼來源:backend_wx.py

示例15: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import Frame [as 別名]
def __init__(self, engine, outputs):
        self.engine = engine
        self.capture = engine.capture
        self.outputs = outputs
        self.frame = wx.Frame(None, wx.ID_ANY, "IkaLog GUI", size=(700, 500))
        self.options_gui = OptionsGUI(self)
        self.last_result = ResultsGUI(self)

        self.layout = wx.BoxSizer(wx.VERTICAL)

        self.create_buttons_ui()
        self.layout.Add(self.buttons_layout)

        self.preview = PreviewPanel(self.frame, size=(640, 420))
        self.preview.Bind(EVT_INPUT_FILE_ADDED, self.on_input_file_added)
        self.preview.Bind(EVT_IKALOG_PAUSE, self.on_ikalog_pause)

        self.layout.Add(self.preview, flag=wx.EXPAND)
        self.frame.SetSizer(self.layout)

        # Frame events
        self.frame.Bind(wx.EVT_CLOSE, self.on_close)

        # Video files processed and to be processed.
        self._file_list = [] 
開發者ID:hasegaw,項目名稱:IkaLog,代碼行數:27,代碼來源:gui.py


注:本文中的wx.Frame方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。