本文整理汇总了Python中gtk.HBox.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python HBox.__init__方法的具体用法?Python HBox.__init__怎么用?Python HBox.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gtk.HBox
的用法示例。
在下文中一共展示了HBox.__init__方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from gtk import HBox [as 别名]
# 或者: from gtk.HBox import __init__ [as 别名]
def __init__(self):
HBox.__init__(self)
self.set_spacing(3)
#hour spin
self.__hour_spin = SpinButton()
self.__hour_spin.set_range(00, 99)
self.__hour_spin.set_width_chars(2)
self.__hour_spin.set_increments(1, 1)
self.__hour_spin.set_numeric(True)
self.__hour_spin.set_update_policy(UPDATE_IF_VALID)
self.__hour_spin.set_snap_to_ticks(True)
self.__hour_spin.connect("output", self._on_spin_output)
self.__hour_spin_handler = (self.__hour_spin.connect("value-changed",
self.hour_spin_changed))
self.pack_start(self.__hour_spin)
self.__hour_spin.show()
#separator
sep = Label(":")
self.pack_start(sep, expand=False)
sep.show()
#minute spin
self.__minute_spin = SpinButton()
self.__minute_spin.set_range(00, 59)
self.__minute_spin.set_width_chars(2)
self.__minute_spin.set_increments(1, 1)
self.__minute_spin.set_numeric(True)
self.__minute_spin.set_wrap(True)
self.__minute_spin.set_update_policy(UPDATE_IF_VALID)
self.__minute_spin.set_snap_to_ticks(True)
self.__minute_spin.connect("output", self._on_spin_output)
self.__minute_spin.connect("wrapped", self._on_minute_wrap)
self.__minute_spin_handler = (self.__minute_spin.connect("value-changed",
self.minute_spin_changed))
self.pack_start(self.__minute_spin)
self.__minute_spin.show()
#separator
self.__second_sep = Label(":")
self.pack_start(self.__second_sep, expand=False)
self.__second_sep.show()
#seconds spin
self.__second_spin = SpinButton()
self.__second_spin.set_range(00, 59)
self.__second_spin.set_width_chars(2)
self.__second_spin.set_increments(1, 1)
self.__second_spin.set_numeric(True)
self.__second_spin.set_wrap(True)
self.__second_spin.set_update_policy(UPDATE_IF_VALID)
self.__second_spin.set_snap_to_ticks(True)
self.__second_spin.connect("output", self._on_spin_output)
self.__second_spin.connect("wrapped", self._on_second_wrap)
self.__second_spin_handler = (self.__second_spin.connect("value-changed",
self.second_spin_changed))
self.pack_start(self.__second_spin)
self.__second_spin.show()
示例2: __init__
# 需要导入模块: from gtk import HBox [as 别名]
# 或者: from gtk.HBox import __init__ [as 别名]
def __init__(self, name='UDBar'):
HBox.__init__(self)
self.set_name(name)
self.ubutton = Button('update')
self.dbutton = Button('diff')
self.pack_start(self.ubutton, 0, 0, 0)
self.pack_end(self.dbutton, 0, 0, 0)
self.ubutton.show()
self.dbutton.show()
self.show()
示例3: __init__
# 需要导入模块: from gtk import HBox [as 别名]
# 或者: from gtk.HBox import __init__ [as 别名]
def __init__(self, item, name='ItemLabel'):
HBox.__init__(self)
self.set_name(name)
self._key_, self._val_ = item
self.label = Label(self._key_)
self.vlabel = Label(self._val_)
self.pack_start(self.label,0,0,0)
self.pack_end(self.vlabel,0,0,0)
map(lambda x: x.show(), [self.label, self.vlabel])
self.show()
示例4: __init__
# 需要导入模块: from gtk import HBox [as 别名]
# 或者: from gtk.HBox import __init__ [as 别名]
def __init__(self):
HBox.__init__(self)
MDSplusWidget.__init__(self)
HBox.set_homogeneous(self,False)
self.node_state=CheckButton('')
self.button=Button()
HBox.pack_start(self,self.node_state,False,False,0)
HBox.pack_start(self,self.button,False,False,0)
HBox.pack_start(self,Label(''),True,False,0)
if not guibuilder:
self.button.connect("clicked",self.popupXd)
self.button.connect("realize",self.setButtonLabel)
示例5: __init__
# 需要导入模块: from gtk import HBox [as 别名]
# 或者: from gtk.HBox import __init__ [as 别名]
def __init__(self, name, default=None):
HBox.__init__(self)
self.set_name(name)
self.label = Label(name)
self.entry = Entry()
self.pack_start(self.label, True, True, 0)
self.add(self.entry)
self.label.show()
self.entry.show()
if default:
self.set(default)
self.show()
示例6: __init__
# 需要导入模块: from gtk import HBox [as 别名]
# 或者: from gtk.HBox import __init__ [as 别名]
def __init__(self, queue):
HBox.__init__(self)
self.thread = DlWorker(queue, self.progress, self.set_url)
self.label = Label("hello")
self.pbar = ProgressBar()
self.pack_start(self.label, FALSE, FALSE, 0)
self.pack_end(self.pbar, FALSE, FALSE, 0)
self.label.show()
self.pbar.show()
self.show()
self._done = False
self._started = False