本文整理汇总了Python中kano.gtk3.buttons.KanoButton.disconnect_handlers方法的典型用法代码示例。如果您正苦于以下问题:Python KanoButton.disconnect_handlers方法的具体用法?Python KanoButton.disconnect_handlers怎么用?Python KanoButton.disconnect_handlers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kano.gtk3.buttons.KanoButton
的用法示例。
在下文中一共展示了KanoButton.disconnect_handlers方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: LoggedIn
# 需要导入模块: from kano.gtk3.buttons import KanoButton [as 别名]
# 或者: from kano.gtk3.buttons.KanoButton import disconnect_handlers [as 别名]
class LoggedIn(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title='Profile')
self.set_size_request(200, 150)
self.set_decorated(False)
self.set_position(Gtk.WindowPosition.CENTER)
self.set_resizable(False)
self.ok_button = KanoButton(_("OK"))
self.ok_button.pack_and_align()
self.ok_button.set_padding(20, 20, 0, 0)
self.ok_button.connect("clicked", Gtk.main_quit)
self.title = Heading(_("Logged in!"), _("You're already logged in"))
self.main_container = Gtk.Box(
orientation=Gtk.Orientation.VERTICAL, spacing=0)
self.add(self.main_container)
self.main_container.pack_start(self.title.container, False, False, 0)
self.main_container.pack_start(self.ok_button.align, False, False, 0)
# To get a logout button, uncomment out the lines below
#self.logout_button = OrangeButton(_("Log out?"))
#self.logout_button.connect("clicked", self.logout)
#self.main_container.pack_start(self.logout_button, False, False, 0)
self.connect('delete-event', Gtk.main_quit)
self.show_all()
def logged_out_screen(self):
for child in self.main_container:
self.main_container.remove(child)
self.title.set_text(_("Logged out!"), "")
self.main_container.pack_start(self.title.container, False, False, 0)
self.main_container.pack_start(self.alignment, False, False, 0)
def logout(self, event):
remove_token()
self.logged_out_screen()
def close_window(self, event, button, win):
self.ok_button.disconnect_handlers()
cursor.arrow_cursor(None, None, win)
Gtk.main_quit()