本文整理汇总了Python中gtk.VBox.pack_end方法的典型用法代码示例。如果您正苦于以下问题:Python VBox.pack_end方法的具体用法?Python VBox.pack_end怎么用?Python VBox.pack_end使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gtk.VBox
的用法示例。
在下文中一共展示了VBox.pack_end方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: multipage_glade_editor
# 需要导入模块: from gtk import VBox [as 别名]
# 或者: from gtk.VBox import pack_end [as 别名]
#.........这里部分代码省略.........
# there
#
# when we're in headless mode the maincontainer can just be
# the mainvbox itself
#
# but, outside headless mode we save screen real-estate and
# place a scrolled window (which becomes the maincontainer)
# inside the mainvbox and the glade by glade pages end up
# in there instead (again, in attach_current_page)
if display_mode in HEADLESS_MODES:
self.maincontainer = self.mainvbox
else:
self.maincontainer = Viewport()
sw = ScrolledWindow()
sw.set_policy(POLICY_AUTOMATIC, POLICY_AUTOMATIC)
sw.add( self.maincontainer)
self.mainvbox.pack_start(sw)
self.glade_pages = [
self.__setup_page(glade_file, top_glade_element)
for glade_file, top_glade_element in config.pages ]
self.glade_pages_by_ident_index = dict(
( (key, self.glade_pages[i])
for i, key in enumerate(config.pages)
) # end generator expression
) # end dict
self.__setup_auto_widgets()
self.current_page = 0
self.attach_current_page()
button_hbox = HBox()
self.mainvbox.pack_end(button_hbox, expand=False)
self.nav_buts = dict( (Button(), i)
for i in range(2) )
for but, i in self.nav_buts.iteritems():
but.set_property('use-stock', True)
but.set_label( STOCK_GO_BACK
if i == GLADE_BACK_NAV else STOCK_GO_FORWARD )
button_hbox.pack_start(but, expand=False)
but.connect("clicked", self.nav_but_clicked)
config.gui_initialization_hook(
self, self.trans, self.plugin, self.book)
self.mainvbox.show_all()
self.mainvbox.reparent(self.gui_parent)
def page_is_current(self, page):
# assumption is that config is fine and we're on a page
assert( hasattr(self, 'glade_pages_by_ident_index') and
True )
return \
self.glade_pages_by_ident_index[page] == self.current_widget_dict
def __setup_page(self, glade_file, top_glade_element):
widget_dict = {}
# this should come from the config, seeing how we're setting up
# our stuff manually
event_handlers_dict = {}
load_glade_file_get_widgets_and_connect_signals(
glade_file, top_glade_element,
widget_dict, event_handlers_dict )
widget_dict[top_glade_element].hide()