def setButtons(self, state): """ Toggle for the button states. """ if state == True: self.bt_Extract.Enable() self.bt_MainDatabase.Enable() self.bt_SaveLog.Enable() self.bt_TargetDatabase.Enable() self.ck_ExtractVerbose.Enable() self.ck_OverwriteExisting.Enable() self.bt_SaveDefaults.Enable() # self.bt_AddSched.Enable() Publisher().sendMessage(('setLaunchPanel'), "Enable") Publisher().sendMessage(('setScanPanel'), "Enable") Publisher().sendMessage(('setVirtualPanel'), "Enable") wx.SetCursor(wx.StockCursor(wx.CURSOR_ARROW)) else: self.bt_Extract.Disable() self.bt_MainDatabase.Disable() self.bt_SaveLog.Disable() self.bt_TargetDatabase.Disable() self.ck_ExtractVerbose.Disable() self.ck_OverwriteExisting.Disable() self.bt_SaveDefaults.Disable() self.bt_AddSched.Disable() Publisher().sendMessage(('setLaunchPanel'), "Disable") Publisher().sendMessage(('setScanPanel'), "Disable") Publisher().sendMessage(('setVirtualPanel'), "Disable") wx.SetCursor(wx.StockCursor(wx.CURSOR_WATCH))
def on_motion_new_gate(self, evt): '''Mouse motion handler for empty gates that need to be created first. Handle cursor changes and gate dragging. ''' if evt.xdata and evt.ydata: wx.SetCursor(wx.StockCursor(wx.CURSOR_CROSS)) if self.dragging: if self.x_column: xmin = min(self._mouse_xy_data[0], evt.xdata) xmax = max(self._mouse_xy_data[0], evt.xdata) if self.x_column not in [g.get_column() for g in self.gate.get_subgates()]: self.gate.add_subgate(sql.Gate1D(self.x_column.copy(), (xmin, xmax))) else: for subgate in self.gate.get_subgates(): if subgate.get_column() == self.x_column: subgate.set_range(xmin, xmax) if self.y_column and self.y_column != self.x_column: ymin = min(self._mouse_xy_data[1], evt.ydata) ymax = max(self._mouse_xy_data[1], evt.ydata) if self.y_column not in [g.get_column() for g in self.gate.get_subgates()]: self.gate.add_subgate(sql.Gate1D(self.y_column.copy(), (ymin, ymax))) else: for subgate in self.gate.get_subgates(): if subgate.get_column() == self.y_column: subgate.set_range(ymin, ymax) return else: wx.SetCursor(wx.StockCursor(wx.CURSOR_ARROW))
def OnMouseMotion(self, event): where = self.get_axis(event, self.axis_width) if where == 'bottom' or where == 'right' or where == 'left' or where == '3rd': wx.SetCursor(wx.Cursor(wx.CURSOR_MAGNIFIER)) else: wx.SetCursor(wx.Cursor(wx.CURSOR_ARROW)) if where == 'bottom' and self.press: dx = event.xdata - self.x0 dy = event.ydata - self.y0 self.ax1.set_xlim(self.ax1.get_xlim()[0] - dx, self.ax1.get_xlim()[1] - dx) self.Draw(False) if where == 'main' and self.press: self.span.set_bounds(self.x0,\ self.ax1.get_ylim()[0],\ event.xdata-self.x0,\ self.ax1.get_ylim()[1]-self.ax1.get_ylim()[0]) self.Draw(True) if where == 'main' and self.cursor != None: self.cursor.set_xdata(event.xdata) xval = event.xdata idx = np.searchsorted(self.ax1.get_lines()[0].get_data()[0], xval) while self.gpx['ok'][ idx] == False and idx >= 0: #look for nearest enabled point idx -= 1 idx = clamp(idx, 0, self.gpx.get_row_count() - 1) self.cursor.set_xdata(self.x_to_num(self.gpx[self.xaxis][idx])) msgwrap.message("CurChanged", arg1=self.id, arg2=idx) ##send a message for the status bar self.UpdateStatusBar(idx) self.Draw(True)
def onMotion(self, evt): if abs(evt.GetX() - int(self.scale.x0)) < 3: wx.SetCursor(wx.StockCursor(wx.CURSOR_SIZEWE)) if self.leftPressed and abs(self.dragX(evt)) > 0: if not self.cursorDragging(): self.cursors.append(Cursor(True, self.scale.x0, True)) elif abs(evt.GetY() - int(self.scale.y0)) < 3: wx.SetCursor(wx.StockCursor(wx.CURSOR_SIZENS)) if self.leftPressed and abs(self.dragY(evt)) > 0: if not self.cursorDragging(): self.cursors.append(Cursor(False, self.scale.y0, True)) else: wx.SetCursor(wx.StockCursor(wx.CURSOR_ARROW)) self.moveCursor(evt) if not self.leftPressed: for c in self.cursors: c.dragging = False if not self.cursorDragging(): if self.leftPressed: dxp = evt.GetX() - self.lastCoords[0] dyp = evt.GetY() - self.lastCoords[1] self.scale.drag(self, dxp, dyp) self.rePaint() self.lastCoords = (evt.GetX(), evt.GetY())
def _OnLeftUp(self, event): if self._mouseState in [self.MS_DRAG_LEFT, self.MS_DRAG_RIGHT]: self.ReleaseMouse() wx.SetCursor(wx.NullCursor) e = wx.PyCommandEvent(wxEVT_EVENT_DATES_CHANGED) e.event = self._mouseOrigin.event e.start = self._mouseDragPos if self._mouseState == self.MS_DRAG_LEFT else self.GetStart( self._mouseOrigin.event) e.end = self._mouseDragPos if self._mouseState == self.MS_DRAG_RIGHT else self.GetEnd( self._mouseOrigin.event) e.SetEventObject(self) self.ProcessEvent(e) elif self._mouseState == self.MS_DRAGGING: self.ReleaseMouse() wx.SetCursor(wx.NullCursor) e = wx.PyCommandEvent(wxEVT_EVENT_DATES_CHANGED) e.event = self._mouseOrigin.event e.start = self._mouseDragPos e.end = e.start + (self.GetEnd(self._mouseOrigin.event) - self.GetStart(self._mouseOrigin.event)) e.SetEventObject(self) self.ProcessEvent(e) self._mouseState = self.MS_IDLE self._mouseOrigin = None self._mouseDragPos = None self.Refresh()
def setButtons(self, state): """ Toggle for the button states. """ if state == True: self.bt_FoldersToScanAdd.Enable() self.bt_FoldersToScanClear.Enable() self.bt_MainDatabase.Enable() self.bt_SaveLog.Enable() self.bt_ScanRepair.Enable() self.bt_ScanUpdate.Enable() self.ck_ScanVerbose.Enable() self.bt_SaveDefaults.Enable() # self.bt_INI.Enable() wx.SetCursor(wx.StockCursor(wx.CURSOR_ARROW)) Publisher().sendMessage(('setLaunchPanel'), "Enable") Publisher().sendMessage(('setExtractPanel'), "Enable") Publisher().sendMessage(('setVirtualPanel'), "Enable") else: self.bt_FoldersToScanAdd.Disable() self.bt_FoldersToScanClear.Disable() self.bt_MainDatabase.Disable() self.bt_SaveLog.Disable() self.bt_ScanRepair.Disable() self.bt_ScanUpdate.Disable() self.ck_ScanVerbose.Disable() self.bt_SaveDefaults.Disable() # self.bt_INI.Disable() Publisher().sendMessage(('setLaunchPanel'), "Disable") Publisher().sendMessage(('setExtractPanel'), "Disable") Publisher().sendMessage(('setVirtualPanel'), "Disable") wx.SetCursor(wx.StockCursor(wx.CURSOR_WATCH))
def SetItem(self, index, col, data, is_init=False): # hopefully whatever the user input is valid... (data will pass # through the validation steps on the Element side) if not is_init: var = self.__keys[index] self.__vars[var] = data # go ahead and update the text fields on display and redraw the canvas self.__UpdateItem(index) if not is_init: old_cursor = self.__parent.GetCursor() new_cursor = wx.Cursor(wx.CURSOR_WAIT) wx.SetCursor(new_cursor) wx.SafeYield() try: # self.__parent.GetContext().ReValueAll() self.__parent.GetContext().ReSortAll() self.__parent.GetContext().GoToHC() self.__parent.GetContext().RefreshFrame() except Exception as ex: raise ex finally: wx.SetCursor(old_cursor) wx.SafeYield()
def PopulateList(self,bDuringInit=False): wx.SetCursor(wx.HOURGLASS_CURSOR) # clear list self.m_list.ClearAll() self.currentItem = -1 # but since we want images on the column header we have to do it the hard way: self.m_list.InsertColumn(IDC_ISIN, message('isin'), wx.LIST_FORMAT_LEFT, wx.LIST_AUTOSIZE) self.m_list.InsertColumn(IDC_TICKER, message('ticker'), wx.LIST_FORMAT_LEFT, wx.LIST_AUTOSIZE) self.m_list.InsertColumn(IDC_NAME, message('name'), wx.LIST_FORMAT_LEFT, wx.LIST_AUTOSIZE) self.m_list.InsertColumn(IDC_PLACE, message('place'), wx.LIST_FORMAT_LEFT, wx.LIST_AUTOSIZE) self.m_list.InsertColumn(IDC_MARKET, message('market'), wx.LIST_FORMAT_LEFT, wx.LIST_AUTOSIZE) x = 0 self.itemDataMap = {} self.itemQuoteMap = {} self.itemLineMap = {} for eachQuote in quotes.list(): if (not self.m_filter or eachQuote.isMatrix()) and self.isFiltered(eachQuote,bDuringInit): self.itemDataMap[x] = (eachQuote.isin(),eachQuote.ticker(),eachQuote.name(),eachQuote.place(),eachQuote.market()) self.itemQuoteMap[x] = eachQuote x = x + 1 items = self.itemDataMap.items() line = 0 curline = -1 for x in range(len(items)): key, data = items[x] if data[0]!='': self.m_list.InsertImageStringItem(line, data[0], self.sm_q) else: self.m_list.InsertImageStringItem(line, data[0], self.sm_i) if data[0] == self.m_isin and data[1]== self.m_ticker and data[3] == self.m_place and data[4] == self.m_market: # current selection curline = line self.m_list.SetStringItem(line, IDC_TICKER, data[1]) self.m_list.SetStringItem(line, IDC_NAME, data[2]) self.m_list.SetStringItem(line, IDC_PLACE, data[3]) self.m_list.SetStringItem(line, IDC_MARKET, data[4]) self.m_list.SetItemData(line, key) self.itemLineMap[data[1]] = line line += 1 self.m_list.SetColumnWidth(IDC_ISIN, wx.LIST_AUTOSIZE) self.m_list.SetColumnWidth(IDC_TICKER, wx.LIST_AUTOSIZE_USEHEADER) self.m_list.SetColumnWidth(IDC_NAME, 16*10) self.m_list.SetColumnWidth(IDC_PLACE, wx.LIST_AUTOSIZE) self.m_list.SetColumnWidth(IDC_MARKET, wx.LIST_AUTOSIZE) self.SetCurrentItem(curline) wx.SetCursor(wx.STANDARD_CURSOR)
def OnMouseMotion(self,event): where=self.get_axis(event,25) if where=='bottom' or where=='left': wx.SetCursor(wx.Cursor(wx.CURSOR_MAGNIFIER)) else: wx.SetCursor(wx.Cursor(wx.CURSOR_ARROW)) if where=='bottom' and self.dragging: dx = event.xdata - self.x0 self.ax.set_xlim(self.ax.get_xlim()[0]-dx,self.ax.get_xlim()[1]-dx) if where=='left' and self.dragging: dy = event.ydata - self.y0 self.ax.set_ylim(self.ax.get_ylim()[0]-dy,self.ax.get_ylim()[1]-dy) self.gpxcanvas.draw()
def MouseUp(self,evt): if self.selected_point == 'none': return wx.SetCursor(wx.StockCursor(wx.CURSOR_ARROW)) resize = self.img_wind.get_resize() x = evt.GetX() / resize #y = evt.GetY() / resize y = self.im.shape[0] - evt.GetY() / resize if (x > self.im.shape[1]) or (y > self.im.shape[0]): self.selected_point = 'none' return if self.selected_point == 'center': self.arena_center_x = x self.arena_center_y = y else: self.edgepoint[0] = x self.edgepoint[1] = y self.arena_radius = num.sqrt((self.edgepoint[0]-self.arena_center_x)**2.+(self.edgepoint[1]-self.arena_center_y)**2.) self.force_edgepoint_inbounds() self.selected_point = 'none' self.display_parameters() self.ShowImage()
def _release_mouse(self): wx.SetCursor(wx.NullCursor) try: self.ReleaseMouse() except: pass self._mouse_lock = False
def OnDragboxClick(self, event): """ Handle left-click on findtool """ if self.HasCapture(): event.Skip() return self.startFunc() #nothing targeted in the beginning self.lastTarget = None wx.SetCursor(self.cursor) # set the box to the empty image self.dragBoxImage.SetBitmap(self.emptyDragBoxBitmap) self.dragBoxText.SetLabel(self.text.drag2) # from now on we want all mouse motion events self.Bind(wx.EVT_MOTION, self.OnDrag) # and the left up event self.Bind(wx.EVT_LEFT_UP, self.OnDragEnd) # and call Skip in for handling focus events etc. event.ResumePropagation(wx.EVENT_PROPAGATE_MAX) event.Skip() # start capturing the mouse exclusivly self.CaptureMouse()
def OnUpdateConvert(self, event): # can be long ... wx.SetCursor(wx.HOURGLASS_CURSOR) # update currency rate if needed if not currencies.used(self.m_destcur, self.m_orgcur): currencies.inuse(self.m_destcur, self.m_orgcur, True) currencies.get(self.m_destcur, self.m_orgcur) # get the value and convert o = self.wxOrgVal.GetValue() d = convert(self.m_destcur, self.m_orgcur, o) self.wxDestVal.SetLabel('%.3f' % d) # should be enough ! wx.SetCursor(wx.STANDARD_CURSOR)
def OnCaptureLostTestWin(self, evt): frame = self.testWin.GetFrame() wx.SetCursor(wx.NullCursor) frame.ReleaseMouse() frame.Unbind(wx.EVT_LEFT_DOWN) self.frame.tb.ToggleTool(view.frame.ID_TOOL_LOCATE, False) self.frame.miniFrame.tb.ToggleTool(view.frame.ID_TOOL_LOCATE, False)
def __init__(self): wx.Frame.__init__(self, None, -1, 'Loading Images') self.panel = p = wx.Panel(self) wx.SetCursor(wx.Cursor('smiles.ico',wx.BITMAP_TYPE_ICO)) fgs = wx.FlexGridSizer(cols = 2, hgap = 10, vgap = 10) for file in filenames: img1 = wx.Image(file, wx.BITMAP_TYPE_ANY) w = img1.GetWidth() h = img1.GetHeight() img2 = img1.Scale(w/2, h/2) sb1 = wx.StaticBitmap(p, -1, wx.BitmapFromImage(img1)) sb2 = wx.StaticBitmap(p, -1, wx.BitmapFromImage(img2)) fgs.Add(sb1) fgs.Add(sb2) p.SetSizer(fgs) fgs.SetSizeHints(self) self.Fit()
def MouseDown(self,evt): if USEGL: windowheight = self.img_wind_child.GetRect().GetHeight() windowwidth = self.img_wind_child.GetRect().GetWidth() x = evt.GetX() * self.im.shape[1] / windowwidth y = self.im.shape[0] - evt.GetY() * self.im.shape[0] / windowheight else: resize = self.img_wind.get_resize() x = evt.GetX() / resize y = self.im.shape[0] - evt.GetY() / resize #x = evt.GetX()/self.resize #y = evt.GetY()/self.resize # compute distance to center dcenter = num.sqrt((x - self.arena_center_x)**2. + (y - self.arena_center_y)**2.) # compute distance to edgepoint dedge = num.sqrt((x - self.edgepoint[0])**2. + (y - self.edgepoint[1])**2.) mind = min(dcenter,dedge) if mind > DCLICK: return elif dcenter <= dedge: self.selected_point = 'center' else: self.selected_point = 'edge' wx.SetCursor(wx.StockCursor(wx.CURSOR_BULLSEYE))
def saveDataSet(self, dataSet): try: wx.SetCursor(wx.StockCursor(wx.CURSOR_WAIT)) self.parentView.setStatusState(2) dataSetPy = [] dataSetPy.append({ "tableName": "ui_userconfig", "updateType": "delete", "recordSet": dataSet["_userconfig"] }) dataSetPy.append({ "tableName": "ui_userconfig", "updateType": "update", "recordSet": dataSet["userconfig"] }) conn = npiAdapter(self.parentView.application.app_settings["url"] + "/" + self.parentView.application. app_config["connection"]["npi_service"]) response = conn.saveDataSet(self.parentView.getCredentials(), dataSetPy) if response == "error": return else: dataSet["_userconfig"] = [] dataSet["changeData"] = False self.loadDataset(dataSet) except Exception, err: wx.MessageBox(str(err), "saveDataSet", wx.OK | wx.ICON_ERROR)
def OnAccess(self,e): # get the connector m = self.accessmenu.FindItemById(e.GetId()) m = m.GetText() c = getLoginConnector(m) if c: # with the connector, load user info and open UI u,p = c.loadUserInfo() u,p = login_UI(self,u,p,c) # now, save new user info wx.SetCursor(wx.HOURGLASS_CURSOR) c.saveUserInfo(u,p) if itrade_config.isConnected(): # and apply these ne login info c.login(u,p) wx.SetCursor(wx.STANDARD_CURSOR)
def ConvertToNegative(self, event): frame = wx.Frame(None, -1, 'Convert To Negative', pos=(0, 0)) self.frame2 = frame panel = wx.PyScrolledWindow(frame, style=wx.STAY_ON_TOP) img = wx.Image(self.imagePath, wx.BITMAP_TYPE_ANY) wx.SetCursor(wx.StockCursor(wx.CURSOR_ARROWWAIT)) progress = wx.ProgressDialog(title="Converting to negative", message="Processing", maximum=img.GetWidth(), parent=frame, style=wx.PD_AUTO_HIDE | wx.PD_ELAPSED_TIME | wx.PD_ESTIMATED_TIME) for i in range(img.GetWidth()): progress.Update(i) for j in range(img.GetHeight()): img.SetRGB(i, j, 255 - img.GetRed(i, j), 255 - img.GetGreen(i, j), 255 - img.GetRed(i, j)) wx.SetCursor(self.cursor) progress.Destroy() self.newImage = img imageBox = wx.StaticBitmap(panel, wx.ID_ANY, wx.BitmapFromImage(img)) frame_size = self.AdjustFrameSize(img.GetSize()) scrollbar = self.IsEnableScrollbar(frame_size) panel.EnableScrolling(scrollbar[0], scrollbar[1]) ratio = self.GetScrollbarRatio(frame_size) panel.SetScrollbars(ratio[0], ratio[1], ratio[2], ratio[3]) panel.AdjustScrollbars() frame.SetClientSize(frame_size) panel.SetScale(0.1, 0.1) frame.SetMenuBar(self.MakeMenubar()) frame.SetMenuBar(self.MakeMenubar()) frame.Bind(wx.EVT_MENU, self.SaveImage, id=wx.ID_SAVE) frame.Bind(wx.EVT_MENU, self.OnOpen, id=wx.ID_OPEN) frame.Bind(wx.EVT_MENU, self.OnClickExit, id=wx.ID_EXIT) frame.Bind(wx.EVT_MENU, self.OnAbout, id=wx.ID_ABOUT) frame.Bind(wx.EVT_MENU, self.OnCredit, id=ID_CREDIT) frame.Bind(wx.EVT_MENU, self.ConvertToGreyscale, id=ID_CONVERT_TO_GREYSCALE) frame.Bind(wx.EVT_MENU, self.ConvertToNegative, id=ID_CONVERT_TO_NEGATIVE) frame.SetClientSize(frame_size) frame.Show()
def _curseur(self, sablier): if sablier: wx.BeginBusyCursor() else: wx.EndBusyCursor() if wx.Platform == '__WXMSW__': # Le curseur disparaît sinon sous Windows !! wx.SetCursor(wx.StockCursor(wx.CURSOR_DEFAULT))
def OnCheckSoftware(self,e): # can be long ... wx.SetCursor(wx.HOURGLASS_CURSOR) url = itrade_config.checkNewRelease() # restore wx.SetCursor(wx.STANDARD_CURSOR) if url=='ok': iTradeInformation(self,message('checksoftware_uptodate'),message('checksoftware_title')) elif url=='dev': iTradeInformation(self,message('checksoftware_development'),message('checksoftware_title')) elif url=='err': iTradeError(self,message('checksoftware_error'),message('checksoftware_title')) else: if iTradeYesNo(self,message('checksoftware_needupdate'),message('checksoftware_title'))==wx.ID_YES: iTradeLaunchBrowser(url,new=True)
def OnOpen(self,e): dp = select_iTradePortfolio(self,self.m_portfolio,'select') if dp: # can be long ... wx.SetCursor(wx.HOURGLASS_CURSOR) self.DoneCurrentPage() dp = loadPortfolio(dp.filename()) self.NewContext(dp)
def _toggle_mouse_lock(self, evt): self.SetFocus() if self._mouse_lock: self._release_mouse() else: self.CaptureMouse() wx.SetCursor(wx.Cursor(wx.CURSOR_BLANK)) self._last_mouse_x, self._last_mouse_y = evt.GetPosition() self._mouse_lock = True
def reset_progress(): self.__progress_stack = [] self.__progress_dictionary = {} if self.__progress_dialog is not None: self.__progress_dialog.Destroy() self.__progress_dialog = None wx.SetCursor(wx.NullCursor) self.set_message_text(WELCOME_MESSAGE) wx.SafeYield(None, True)
def OnLeftDown(self, event): if (self._img is None): return self.was_dragged = False if (event.ShiftDown()): self.shift_was_down = True self.OnMiddleDown(event) elif (not self.flag_set_beam_center_mode): self.OnRecordMouse(event) wx.SetCursor(wx.StockCursor(wx.CURSOR_HAND))
def UpdateCursor(self, reset=False): try: if reset: wx.SetCursor(wx.NullCursor) return new_cursor = u'drag-file' for I in self.GetSelections(): if os.path.isdir(I.Path): new_cursor = u'drag-folder' break wx.SetCursor(GetCursor(new_cursor, 24)) except TypeError: err_l1 = GT(u'Failed to set cursor') err_l2 = GT(u'Details below:') Logger.Error(__name__, u'\n {}\n {}\n\n{}'.format(err_l1, err_l2, traceback.format_exc()))
def ConvertToNegative(self, event): self.frame.ClearBackground() img = self.image wx.SetCursor(wx.StockCursor(wx.CURSOR_ARROWWAIT)) progress = wx.ProgressDialog(title = "Converting to negative", message = "Processing", maximum = img.GetWidth(), parent = self.frame, style = wx.PD_AUTO_HIDE | wx.PD_ELAPSED_TIME | wx.PD_ESTIMATED_TIME) for i in range(img.GetWidth()): progress.Update(i) for j in range(img.GetHeight()): r = img.GetRed(i,j) g = img.GetGreen(i,j) b = img.GetBlue(i,j) img.SetRGB(i, j, 255 - r, 255 - g, 255 - b) wx.SetCursor(self.cursor) progress.Destroy() self.image = img self.imageBox.SetBitmap(wx.BitmapFromImage(img)) self.is_modified = True self.UpdateTitle('Negative') self.panel.Update()
def onLeftDown(self, event): x = event.GetX() y = event.GetY() self.start = [x, y] self.current = self.start print("left down", self.start) noneSelected = 1 for n in self.Nodes: if n.isInside(self.start[0], self.start[1]): n.setSelectedTrue() noneSelected = 0 wx.SetCursor(wx.StockCursor(wx.CURSOR_HAND)) if noneSelected == 1: for n in self.Nodes: n.setSelectedFalse() wx.SetCursor(wx.StockCursor(wx.CURSOR_ARROW)) self.displayNodes()
def NewContext(self,dp): # can be long ... wx.SetCursor(wx.HOURGLASS_CURSOR) # close links self.CloseLinks() # change portfolio self.m_portfolio = dp self.m_matrix = createMatrix(dp.filename(),dp) self.m_market = self.m_portfolio.market() self.initIndice() # should be enough ! wx.SetCursor(wx.STANDARD_CURSOR) # populate current view and refresh self.OnPostInit(None)
def UvspecFinished(self, exit_value): self.finished = True self.AddToLog("Uvspec finished with exit value %s\n" % exit_value) self.PretendIAmWorking.SetValue(100) wx.SetCursor(wx.StockCursor(wx.CURSOR_ARROW)) # standard cursor self.parent.Enable(True) del self.thread os.remove(self.input_file) # if exit_value == 0: # success # self.Close() self.Cancel.SetLabel("Close") self.Bind(wx.EVT_BUTTON, self.OnCloseButton)