本文整理匯總了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()