本文整理匯總了Python中popup.Popup.get_size方法的典型用法代碼示例。如果您正苦於以下問題:Python Popup.get_size方法的具體用法?Python Popup.get_size怎麽用?Python Popup.get_size使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類popup.Popup
的用法示例。
在下文中一共展示了Popup.get_size方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: show_popup
# 需要導入模塊: from popup import Popup [as 別名]
# 或者: from popup.Popup import get_size [as 別名]
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.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()
else:
# No text, no Popup, set __textnotif 'close'.
self.__textnotif = 'close'
示例2: show_popup
# 需要導入模塊: from popup import Popup [as 別名]
# 或者: from popup.Popup import get_size [as 別名]
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.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()