def show_popup(self): '''Show the text notification popup.''' text = self.msgtext.GetValue() if text: # Text is set, show dialog. Status of text notification. self.textnotif = 'show' font = self.data.system['msg_font'] colors = self.data.system['popup_colors'] icon = os.path.join(self.mfcdir, self.data.system['icon_close']) popup = Popup(parent=self, style=self.bdist, text=text, font=font, colors=colors, icon=icon) popw, poph = popup.size dispw, disph = wx.GetDisplaySize() offx = (dispw - popw) / 2 offy = (disph - poph) / 2 popup.Position(ptOrigin=(0, 0), size=(offx, offy)) popup.Popup() else: # No text, no Popup, set __textnotif 'close'. self.textnotif = 'close'
def show_popup(self): '''Show the text notification popup.''' text = self.__msgtext.GetValue() if text: # Text is set, show dialog. font = self.__data.get_sys('msg_font') colors = self.__data.get_sys('popup_colors') icon = os.path.join(self.__dir, self.__data.get_sys('icon_close')) popup = Popup(parent=self, style=self.__bdist, text=text, font=font, colors=colors, icon=icon) popw, poph = popup.get_size() dispw, disph = wx.GetDisplaySize() offx = (dispw - popw) / 2 offy = (disph - poph) / 2 popup.Position(ptOrigin=(0, 0), size=(offx, offy)) popup.Popup()