本文整理汇总了Python中dtk.ui.button.Button.hide方法的典型用法代码示例。如果您正苦于以下问题:Python Button.hide方法的具体用法?Python Button.hide怎么用?Python Button.hide使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dtk.ui.button.Button
的用法示例。
在下文中一共展示了Button.hide方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: FootBox
# 需要导入模块: from dtk.ui.button import Button [as 别名]
# 或者: from dtk.ui.button.Button import hide [as 别名]
class FootBox(gtk.HBox):
def __init__(self):
gtk.HBox.__init__(self)
self.set_size_request(-1, 35)
self.apply_method = None
self.init_ui()
self.timer = Timer(3000, self.__clear_tips)
Dispatcher.connect("button-change", self.set_button)
Dispatcher.connect("set-tip", self.set_tip)
event_manager.add_callback("update-delete-button", self.__on_update_delete_button)
def __on_update_delete_button(self, name, obj, data):
#self.btn_delete.set_child_visible(data)
self.queue_draw()
def expose_line(self, widget, event):
cr = widget.window.cairo_create()
rect = widget.allocation
style.draw_out_line(cr, rect)
def init_ui(self):
self.tip_align = gtk.Alignment(0, 0.5, 0, 1)
self.tip = Label("",
text_x_align=pango.ALIGN_CENTER,
label_width=500)
self.tip_align.set_padding(5, 5, 20, 0)
self.tip_align.add(self.tip)
self.btn_delete = Button(_("Delete"))
self.btn_delete.connect("clicked", self.delete_click)
self.btn_delete.set_no_show_all(True)
self.btn_save = Button()
self.btn_save.connect("clicked", self.button_click)
button_box = gtk.HBox(spacing=10)
button_box.pack_start(self.btn_delete)
button_box.pack_start(self.btn_save)
self.buttons_align = gtk.Alignment(1, 0.5, 0, 0)
self.buttons_align.set_padding(0, 0, 0, 10)
self.buttons_align.add(button_box)
self.pack(self, [self.tip_align], True, True)
self.pack_end(self.buttons_align, False, False)
def pack(self, parent, widgets, expand=False, fill=False):
for widget in widgets:
parent.pack_start(widget, expand, fill)
def set_lock(self, state):
self.__setting_module.set_lock(state)
def get_lock(self):
return self.__setting_module.get_lock()
def set_button(self, widget, content, state):
self.btn_save.set_label(_("Save"))
self.btn_save.set_sensitive(state)
def delete_click(self, widget):
if self.focus_connection:
Dispatcher.delete_setting(self.focus_connection)
Dispatcher.to_main_page()
def show_delete(self, connection):
self.btn_delete.show()
self.focus_connection = connection
def hide_delete(self):
self.btn_delete.hide()
self.focus_connection = None
#if content == "save":
#if state and not self.get_lock():
#Dispatcher.emit("setting-saved")
#else:
#self.btn_save.set_label(_("connect"))
#self.btn_save.set_sensitive(False)
#else:
#self.btn_save.set_label(_("connect"))
#self.btn_save.set_sensitive(True)
def get_button(self):
return self.__setting_module.get_button_state()
def set_setting(self, module):
self.__setting_module = module
def button_click(self, widget):
#if self.btn_save.label == "save":
Dispatcher.emit("setting-saved")
#elif self.btn_save.label == _("connect"):
#Dispatcher.set_tip("setting saved")
#Dispatcher.emit("setting-appled")
#.........这里部分代码省略.........