本文整理汇总了Python中higwidgets.higboxes.HIGHBox.add方法的典型用法代码示例。如果您正苦于以下问题:Python HIGHBox.add方法的具体用法?Python HIGHBox.add怎么用?Python HIGHBox.add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类higwidgets.higboxes.HIGHBox
的用法示例。
在下文中一共展示了HIGHBox.add方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: SuperPeerListWindow
# 需要导入模块: from higwidgets.higboxes import HIGHBox [as 别名]
# 或者: from higwidgets.higboxes.HIGHBox import add [as 别名]
class SuperPeerListWindow(HIGWindow):
def __init__(self):
HIGWindow.__init__(self, type=gtk.WINDOW_TOPLEVEL)
self.set_title(_('Super Peers List'))
self.set_position(gtk.WIN_POS_CENTER_ALWAYS)
self.__create_widgets()
self.__pack_widgets()
self.__load_super_peers()
def __create_widgets(self):
self.main_vbox = HIGVBox()
self.add(self.main_vbox)
self.btn_box = gtk.HButtonBox()
self.ok_button = gtk.Button(stock=gtk.STOCK_SAVE)
self.ok_button.connect('clicked', lambda x: self.__save_super_peers())
self.cancel_button = gtk.Button(stock=gtk.STOCK_CANCEL)
self.cancel_button.connect('clicked', lambda x: self.destroy())
self.SuperPeersBox_vbox = HIGVBox()
self.SuperPeersBox_hbox1 = HIGHBox()
self.SuperPeersBox_hbox2 = HIGHBox()
self.SuperPeersBox_subbox = SuperPeersBox()
self.SuperPeersBox_hbox1.add(self.SuperPeersBox_subbox)
def __pack_widgets(self):
self.main_vbox._pack_expand_fill(self.SuperPeersBox_hbox1)
self.btn_box.set_layout(gtk.BUTTONBOX_END)
self.btn_box.set_spacing(3)
self.btn_box.pack_start(self.ok_button)
self.btn_box.pack_start(self.cancel_button)
self.main_vbox.pack_start(self.btn_box)
self.main_vbox.set_border_width(8)
self.SuperPeersBox_vbox.pack_start(self.SuperPeersBox_hbox1, True, True, 5)
self.SuperPeersBox_vbox.pack_start(self.SuperPeersBox_hbox2, True, True, 5)
def __save_super_peers(self):
self.destroy()
def __load_super_peers(self):
text = ""
for peer_entry in theApp.peer_manager.super_peers.values():
text = text + "%s:%d\n" % (peer_entry.IP, peer_entry.Port)
self.SuperPeersBox_subbox.textbuffer.set_text(text)
示例2: TestPage
# 需要导入模块: from higwidgets.higboxes import HIGHBox [as 别名]
# 或者: from higwidgets.higboxes.HIGHBox import add [as 别名]
class TestPage(HIGVBox):
""""""
#----------------------------------------------------------------------
def __init__(self):
"""Constructor"""
HIGVBox.__init__(self)
self.__create_widgets()
self.__pack_widgets()
def __create_widgets(self):
self.hbox1 = HIGHBox()
self.hbox2 = HIGHBox()
self.subbox = Tests()
self.hbox1.add(self.subbox)
self.checkbtn = gtk.CheckButton(_("Update tests module automatically"))
self.checkbtn_throttled = gtk.CheckButton(_("Load HTTP Throttled Test"))
def __pack_widgets(self):
#self.tests_hbox.set_border_width(12)
self.pack_start(self.hbox1, True, True, 5)
self.pack_start(self.hbox2, True, True, 5)
self.checkbtn.set_border_width(8)
self.checkbtn_throttled.set_border_width(8)
self.hbox2.add(self.checkbtn)
self.hbox2.add(self.checkbtn_throttled)