本文整理汇总了Python中wx.EVT_CLOSE属性的典型用法代码示例。如果您正苦于以下问题:Python wx.EVT_CLOSE属性的具体用法?Python wx.EVT_CLOSE怎么用?Python wx.EVT_CLOSE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类wx
的用法示例。
在下文中一共展示了wx.EVT_CLOSE属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _init_ctrls
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_CLOSE [as 别名]
def _init_ctrls(self, prnt):
wx.Frame.__init__(self, id=ID_OBJDICTEDIT, name='objdictedit',
parent=prnt, pos=wx.Point(149, 178), size=wx.Size(1000, 700),
style=wx.DEFAULT_FRAME_STYLE, title=_('Objdictedit'))
self._init_utils()
self.SetClientSize(wx.Size(1000, 700))
self.SetMenuBar(self.MenuBar)
self.Bind(wx.EVT_CLOSE, self.OnCloseFrame)
if not self.ModeSolo:
self.Bind(wx.EVT_MENU, self.OnSaveMenu, id=wx.ID_SAVE)
accel = wx.AcceleratorTable([wx.AcceleratorEntry(wx.ACCEL_CTRL, 83, wx.ID_SAVE)])
self.SetAcceleratorTable(accel)
self.FileOpened = wx.Notebook(id=ID_OBJDICTEDITFILEOPENED,
name='FileOpened', parent=self, pos=wx.Point(0, 0),
size=wx.Size(0, 0), style=0)
self.FileOpened.Bind(wx.EVT_NOTEBOOK_PAGE_CHANGED,
self.OnFileSelectedChanged, id=ID_OBJDICTEDITFILEOPENED)
self.HelpBar = wx.StatusBar(id=ID_OBJDICTEDITHELPBAR, name='HelpBar',
parent=self, style=wx.ST_SIZEGRIP)
self._init_coll_HelpBar_Fields(self.HelpBar)
self.SetStatusBar(self.HelpBar)
示例2: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_CLOSE [as 别名]
def __init__(self, parent):
wx.Dialog.__init__(self, parent, wx.ID_ANY, "Manual Entry", size=(650, 600))
self.panel = wx.Panel(self, wx.ID_ANY)
self.mainSizer = wx.BoxSizer(wx.VERTICAL)
self.folios = self.fetchFolios()
self.lblFolioD = wx.StaticText(self.panel, label="Folio (Debit)")
self.folioComboD = wx.ComboBox(self.panel, choices=list(self.folios.keys()))
self.mainSizer.Add(self.lblFolioD)
self.mainSizer.Add(self.folioComboD)
self.SetSizer(self.mainSizer)
self.Layout()
self.mainSizer.Fit(self.panel)
self.Centre(wx.BOTH)
self.Bind(wx.EVT_CLOSE, self.OnQuit)
self.Show()
示例3: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_CLOSE [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)
示例4: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_CLOSE [as 别名]
def __init__(self, parent, help_entries):
wx.Dialog.__init__(self, parent, title="Help",
style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)
sizer = wx.BoxSizer(wx.VERTICAL)
grid_sizer = wx.FlexGridSizer(0, 3, 8, 6)
# create and add the entries
bold = self.GetFont().MakeBold()
for r, row in enumerate(self.headers + help_entries):
for (col, width) in zip(row, self.widths):
label = wx.StaticText(self, label=col)
if r == 0:
label.SetFont(bold)
label.Wrap(width)
grid_sizer.Add(label, 0, 0, 0)
# finalize layout, create button
sizer.Add(grid_sizer, 0, wx.ALL, 6)
OK = wx.Button(self, wx.ID_OK)
sizer.Add(OK, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALL, 8)
self.SetSizer(sizer)
sizer.Fit(self)
self.Layout()
self.Bind(wx.EVT_CLOSE, self.OnClose)
OK.Bind(wx.EVT_BUTTON, self.OnClose)
示例5: OnInit
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_CLOSE [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
示例6: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_CLOSE [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 = []
示例7: _on_close
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_CLOSE [as 别名]
def _on_close(self, event):
"""Event handler for the wx.EVT_CLOSE event.
This method is used when the user tries to close the program
to save the options and make sure that the download & update
processes are not running.
"""
if self.opt_manager.options["confirm_exit"]:
dlg = wx.MessageDialog(self, _("Are you sure you want to exit?"), _("Exit"), wx.YES_NO | wx.ICON_QUESTION)
result = dlg.ShowModal() == wx.ID_YES
dlg.Destroy()
else:
result = True
if result:
self.close()
示例8: _init_ctrls
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_CLOSE [as 别名]
def _init_ctrls(self, prnt):
wx.Frame.__init__(self, id=ID_NETWORKEDIT, name='networkedit',
parent=prnt, pos=wx.Point(149, 178), size=wx.Size(1000, 700),
style=wx.DEFAULT_FRAME_STYLE, title=_('Networkedit'))
self._init_utils()
self.SetClientSize(wx.Size(1000, 700))
self.SetMenuBar(self.MenuBar)
self.Bind(wx.EVT_CLOSE, self.OnCloseFrame)
if not self.ModeSolo:
self.Bind(wx.EVT_MENU, self.OnSaveProjectMenu, id=wx.ID_SAVE)
accel = wx.AcceleratorTable([wx.AcceleratorEntry(wx.ACCEL_CTRL, 83, wx.ID_SAVE)])
self.SetAcceleratorTable(accel)
NetworkEditorTemplate._init_ctrls(self, self)
self.HelpBar = wx.StatusBar(id=ID_NETWORKEDITHELPBAR, name='HelpBar',
parent=self, style=wx.ST_SIZEGRIP)
self._init_coll_HelpBar_Fields(self.HelpBar)
self.SetStatusBar(self.HelpBar)
示例9: finish_widget_creation
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_CLOSE [as 别名]
def finish_widget_creation(self, level):
WindowBase.finish_widget_creation(self, level)
if self.CHILDREN: # not for MenuBar, ToolBar
self.drop_target = clipboard.DropTarget(self)
self.widget.SetDropTarget(self.drop_target)
self.widget.SetMinSize = self.widget.SetSize
if self.has_title:
self.widget.SetTitle( misc.design_title(self.title) )
elif hasattr(self.widget, 'SetTitle'):
self.widget.SetTitle(misc.design_title(self.name))
self.widget.Bind(wx.EVT_LEFT_DOWN, self.drop_sizer)
self.widget.Bind(wx.EVT_ENTER_WINDOW, self.on_enter)
self.widget.Bind(wx.EVT_CLOSE, self.hide_widget)
if wx.Platform == '__WXMSW__':
# MSW isn't smart enough to avoid overlapping windows, so at least move it away from the 3 wxGlade frames
self.widget.Center()
示例10: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_CLOSE [as 别名]
def __init__(self, *args, **kwargs):
matplotlib_GUI.MyFrame.__init__(self, *args, **kwargs)
self.figure = self.canvas.figure
self.init_toolmanager()
self.init_events()
# where to save figures by default?
matplotlib.rcParams['savefig.directory'] = "" # defaults to current directory
self.Bind(wx.EVT_CLOSE, self.OnClose)
# initialize values from control values; so the .wxg file needs to have correct initialization values!
self.on_choice_line_style()
self.on_combo_colour()
self.on_combo_line_width()
self.on_choice_subplots()
self.set_history_buttons()
self.on_button_plot()
self.multicursor = None
示例11: create_widget
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_CLOSE [as 别名]
def create_widget(self):
if self.widget:
# re-creating -> use old frame
win = self.widget.GetTopLevelParent()
else:
style = wx.DEFAULT_FRAME_STYLE
if common.pin_design_window: style |= wx.STAY_ON_TOP
win = wx.Frame( common.main, -1, misc.design_title(self.name), size=(400, 300), style=style )
import os, compat
icon = compat.wx_EmptyIcon()
xpm = os.path.join(config.icons_path, 'panel.xpm')
icon.CopyFromBitmap(misc.get_xpm_bitmap(xpm))
win.SetIcon(icon)
win.Bind(wx.EVT_CLOSE, self.hide_widget) # CLOSE event of the frame, not the panel
if wx.Platform == '__WXMSW__':
win.CentreOnScreen()
if self.scrollable:
self.widget = wx.ScrolledWindow(win, self.id, style=0)
else:
self.widget = wx.Panel(win, self.id, style=0)
self.widget.Bind(wx.EVT_ENTER_WINDOW, self.on_enter)
self.widget.GetBestSize = self.get_widget_best_size
#self.widget.SetSize = win.SetSize
示例12: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_CLOSE [as 别名]
def __init__(self, *args, **kwds):
# begin wxGlade: MyFrame.__init__
# frame extra code before
kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE
wx.Frame.__init__(self, *args, **kwds)
self.SetSize((400, 300))
self.SetTitle("frame")
sizer_1 = wx.BoxSizer(wx.VERTICAL)
sizer_1.Add((0, 0), 0, 0, 0)
self.SetSizer(sizer_1)
self.Layout()
# frame extra code after
self.Bind(wx.EVT_CLOSE, self.on_close_frame, self)
self.Bind(wx.EVT_MENU_CLOSE, self.on_menu_close_frame, self)
# end wxGlade
示例13: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_CLOSE [as 别名]
def __init__(self, parent):
wx.Dialog.__init__(self, parent, id=wx.ID_ANY, title=u"控制台日志", pos=wx.DefaultPosition, size=wx.Size(500, 500),
style=wx.DEFAULT_DIALOG_STYLE)
self.SetSizeHints(wx.DefaultSize, wx.DefaultSize)
sizer_global = wx.BoxSizer(wx.VERTICAL)
self.textctrl_log = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size(427, 381),
wx.TE_AUTO_URL | wx.TE_MULTILINE | wx.TE_PROCESS_ENTER | wx.TE_PROCESS_TAB)
# self.listctrl_log = ListCtrl_DLLog(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LC_REPORT)
sizer_global.Add(self.textctrl_log, 1, wx.ALL | wx.EXPAND, 5)
self.SetSizer(sizer_global)
self.Layout()
self.Centre(wx.BOTH)
self.Bind(wx.EVT_CLOSE, self.onClose)
示例14: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_CLOSE [as 别名]
def __init__(self, parent):
wx.Dialog.__init__(self, parent, id=wx.ID_ANY, title=u"链接浏览窗口", pos=wx.DefaultPosition, size=wx.Size(500, 500),
style=wx.DEFAULT_DIALOG_STYLE)
self.SetSizeHints(wx.DefaultSize, wx.DefaultSize)
sizer_global = wx.BoxSizer(wx.VERTICAL)
self.listctrl_links = ListCtrl_CopyLink(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LC_REPORT)
sizer_global.Add(self.listctrl_links, 1, wx.ALL | wx.EXPAND, 5)
self.SetSizer(sizer_global)
self.Layout()
self.Centre(wx.BOTH)
self.Bind(wx.EVT_CLOSE, self.onClose)
示例15: OnClose
# 需要导入模块: import wx [as 别名]
# 或者: from wx import EVT_CLOSE [as 别名]
def OnClose(self, dummyEvent):
"""
Handle wx.EVT_CLOSE
"""
if eg.config.hideOnClose:
self.Iconize(True)
elif len(self.openDialogs) == 0:
eg.app.Exit()
else:
self.Iconize(False)
self.Raise()
for dialog in self.openDialogs:
dialog.Iconize(False)
BringHwndToFront(dialog.GetHandle())
dialog.Raise()
dialog.RequestUserAttention()
self.RequestUserAttention()