本文整理汇总了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()
示例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()
示例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()
示例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)
示例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.''')
示例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")
示例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
示例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)
示例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()
示例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()
示例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)
示例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()
示例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 = []