本文整理汇总了Python中gtk.Label.hide方法的典型用法代码示例。如果您正苦于以下问题:Python Label.hide方法的具体用法?Python Label.hide怎么用?Python Label.hide使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gtk.Label
的用法示例。
在下文中一共展示了Label.hide方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: HourEntry
# 需要导入模块: from gtk import Label [as 别名]
# 或者: from gtk.Label import hide [as 别名]
#.........这里部分代码省略.........
self.minute = int(self.__minute_spin.get_value())
self.__second_spin.set_value(00)
self.second = int(self.__second_spin.get_value())
self.__hour_spin.handler_unblock(self.__hour_spin_handler)
self.__minute_spin.handler_unblock(self.__minute_spin_handler)
self.__second_spin.handler_unblock(self.__second_spin_handler)
self.emit("time_changed")
def get_time(self):
return self.hour, self.minute
# get_properties
def do_get_property(self, property):
data = {"hour":self.hour, "minute":self.minute}
if data.has_key(property.name):
return data[property.name]
else:
raise AttributeError, 'unknown property %s' % property.name
def do_set_property(self, property, value):
if property.name == 'hour':
self.set_hour(value)
elif property.name == 'minute':
self.set_minute(value)
else:
raise AttributeError, 'unknown property %s' % property.name
def _on_minute_wrap(self, obj):
self.lock = True
if obj.get_value() == 59:
value = self.__hour_spin.get_value_as_int() - 1
else:
value = self.__hour_spin.get_value_as_int() + 1
self.__hour_spin.set_value(value)
self.lock = False
self.emit("time_changed")
def _on_second_wrap(self, obj):
self.lock = True
minute_value = self.__minute_spin.get_value_as_int()
second_value = obj.get_value_as_int()
hour_value = None
if minute_value == 59 and second_value == 0:
hour_value = self.__hour_spin.get_value_as_int() + 1
elif minute_value == 0 and second_value == 59:
hour_value = self.__hour_spin.get_value_as_int() - 1
if not(hour_value is None):
self.__hour_spin.set_value(hour_value)
if second_value == 59:
minute_value -= 1
elif second_value == 0:
minute_value += 1
if minute_value == 60:
minute_value = 0
elif minute_value == -1:
minute_value = 59
self.__minute_spin.set_value(minute_value)
self.lock = False
self.emit("time_changed")
def _on_spin_output(self, obj):
obj.set_text("%02d" % obj.get_adjustment().get_value())
return True
def hour_spin_changed(self, obj):
self.hour = obj.get_value_as_int()
if not self.lock:
self.emit("time_changed")
def minute_spin_changed(self, obj):
self.minute = obj.get_value_as_int()
if not self.lock:
self.emit("time_changed")
def second_spin_changed(self, obj):
self.second = obj.get_value_as_int()
if not self.lock:
self.emit("time_changed")
def set_second_visible(self, s):
if s:
self.__second_spin.show()
self.__second_sep.show()
else:
self.__second_spin.hide()
self.__second_sep.hide()