本文整理汇总了Python中subscription_manager.ga.GObject.add_emission_hook方法的典型用法代码示例。如果您正苦于以下问题:Python GObject.add_emission_hook方法的具体用法?Python GObject.add_emission_hook怎么用?Python GObject.add_emission_hook使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类subscription_manager.ga.GObject
的用法示例。
在下文中一共展示了GObject.add_emission_hook方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from subscription_manager.ga import GObject [as 别名]
# 或者: from subscription_manager.ga.GObject import add_emission_hook [as 别名]
def __init__(self, text, parent=None, title=None):
ga_GObject.GObject.__init__(self)
self.rc = None
# this seems to be wordwrapping text passed to
# it, which is making for ugly error messages
self.dialog = ga_Gtk.MessageDialog(parent, 0, self.STYLE, self.BUTTONS)
if title:
self.dialog.set_title(title)
# escape product strings see rh bz#633438
self.dialog.set_markup(text)
self.dialog.set_default_response(0)
self.dialog.set_position(ga_Gtk.WindowPosition.CENTER_ON_PARENT)
self.dialog.show_all()
self.dialog.set_icon_name('subscription-manager')
self.dialog.set_modal(True)
#this seems spurious, but without it, a ref to this obj gets "lost"
ga_GObject.add_emission_hook(self, 'response', self.noop_hook)
self.dialog.connect("response", self._on_response_event)