本文整理汇总了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()