当前位置: 首页>>代码示例>>Python>>正文


Python ScrolledWindow.add方法代码示例

本文整理汇总了Python中gtk.ScrolledWindow.add方法的典型用法代码示例。如果您正苦于以下问题:Python ScrolledWindow.add方法的具体用法?Python ScrolledWindow.add怎么用?Python ScrolledWindow.add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gtk.ScrolledWindow的用法示例。


在下文中一共展示了ScrolledWindow.add方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _setup_layout

# 需要导入模块: from gtk import ScrolledWindow [as 别名]
# 或者: from gtk.ScrolledWindow import add [as 别名]
    def _setup_layout(self):

        hpaned = HPaned()
        label = Label(_("Are you sure you want to install/remove those packages?"))
        label.show()
        inst_frame = Frame(_("Packages to install"))
        rem_frame = Frame(_("Packages to remove"))

        inst_scroll = ScrolledWindow()
        inst_scroll.set_policy(POLICY_AUTOMATIC, POLICY_AUTOMATIC)

        rem_scroll = ScrolledWindow()
        rem_scroll.set_policy(POLICY_AUTOMATIC, POLICY_AUTOMATIC)

        inst_scroll.add(self.install_tree)
        rem_scroll.add(self.remove_tree)
        
        inst_frame.add(inst_scroll)
        rem_frame.add(rem_scroll)

        hpaned.pack1(inst_frame, False, False)
        hpaned.pack2(rem_frame, False, False)
        
        hpaned.show_all()

        self.vbox.pack_start(label, False, False, 0)
        self.vbox.pack_start(hpaned, True, True, 0)
        self.set_default_size(600,300)
        return
开发者ID:BackupTheBerlios,项目名称:gtkpacman-svn,代码行数:31,代码来源:dialogs.py

示例2: _setup_layout

# 需要导入模块: from gtk import ScrolledWindow [as 别名]
# 或者: from gtk.ScrolledWindow import add [as 别名]
    def _setup_layout(self):
        self.vbox = VBox(False, 0)
        self.vbox.show()

        self.terminal = terminal()
        self.terminal.connect("child-exited", lambda _: self.close_button.show())
        
        self.expander = expander_new_with_mnemonic(_("_Terminal"))
        self.expander.set_expanded(False)
        self.expander.add(self.terminal)
        self.expander.show_all()
        
        self.close_button = Button(stock=STOCK_CLOSE)
        self.close_button.connect("clicked", lambda _: self.destroy())

        scr = ScrolledWindow()
        scr.set_policy ("automatic", "automatic")
        scr.add (self.tree)
        scr.show()

        vpaned = VPaned()
        vpaned.add1(scr)
        vpaned.add2(self.expander)
        vpaned.set_position (260)
        vpaned.show()

        self.vbox.pack_start(vpaned, True, True, 0)
        self.vbox.pack_start(self.close_button, False, False, 0)

        self.add(self.vbox)
        return
开发者ID:BackupTheBerlios,项目名称:gtkpacman-svn,代码行数:33,代码来源:dialogs.py

示例3: _setup_layout

# 需要导入模块: from gtk import ScrolledWindow [as 别名]
# 或者: from gtk.ScrolledWindow import add [as 别名]
    def _setup_layout(self):

        self.set_default_size(600,200)
        label = Label(_("Are you sure you want to install/remove those packages?\n"))
        self.hpaned = HPaned()
        
        inst_scroll = ScrolledWindow()
        inst_scroll.set_policy(POLICY_AUTOMATIC, POLICY_AUTOMATIC)

        rem_scroll = ScrolledWindow()
        rem_scroll.set_policy(POLICY_AUTOMATIC, POLICY_AUTOMATIC)
        
        inst_scroll.add(self.install_tree)
        rem_scroll.add(self.remove_tree)
        
        self.hpaned.pack1(inst_scroll, False, False)
        self.hpaned.pack2(rem_scroll, False, False)
    
        self.vbox.pack_start( label, False, False, 0 )
        self.vbox.pack_start( self.hpaned, True, True, 0 )
        self.vbox.pack_start( self.expander, False, False, 0 )
        
        self.show_all()
        self.expander.hide_all()
        self.close_button.hide()
开发者ID:BackupTheBerlios,项目名称:gtkpacman-svn,代码行数:27,代码来源:dialogs.py

示例4: __init__

# 需要导入模块: from gtk import ScrolledWindow [as 别名]
# 或者: from gtk.ScrolledWindow import add [as 别名]
class Dan:
	def __init__(self):
		self.url = "http://www.bibud.com"
		self.setupWindow()
		self.setupBrowser()
		main()
	def setupWindow(self):
		self.window_title = "Bibud"
		self.window = Window()
		self.window.show()
		self.window.connect("destroy-event", self.browser_quit)
		self.window.resize(1024,768)
		self.window.set_title(self.window_title)
	def setupBrowser(self):
		self.browser = WebView()
		self.browser.show()
		self.browser.open(self.url)
		self.scroller = ScrolledWindow()
		self.scroller.add(self.browser)
		self.window.add(self.scroller)
		self.browser.connect("title-changed", self.title_changed)
		self.scroller.show()
	def eTitleChanged(self, webview, frame, title):
		self.window.set_title(title)
	def eQuit(self):
		main_quit()
开发者ID:ColinKinloch,项目名称:projects,代码行数:28,代码来源:browser.py

示例5: __init__

# 需要导入模块: from gtk import ScrolledWindow [as 别名]
# 或者: from gtk.ScrolledWindow import add [as 别名]
    def __init__(self,
                 trans, transid, plugin, gui_parent, change_register_function,
                 book, display_mode=TRANSACTION_ALL_EDIT_FIRST_TIME,
                 transaction_edit_finished_function=null_function):
        self.trans = trans
        self.transid = transid
        self.plugin = plugin
        self.gui_parent = gui_parent
        self.change_register_function = change_register_function
        self.book = book
        self.display_mode = display_mode
        self.transaction_edit_finished_function = (
            null_function if display_mode not in HEADLESS_MODES
            else transaction_edit_finished_function )

        self.hide_parent = Window()
        self.hide_parent.hide()
        self.mainvbox = VBox()
        self.hide_parent.add(self.mainvbox)

        config = self.trans.get_configuration_and_provide_on_load_hook()
        config_module_name = self.plugin.config_module_name
        if not config_valid(config):
            # even in the case of a broken config, we should still
            # display all of the data we have available...
            self.mainvbox.pack_start(Label("no configuration"))
        elif not self.trans.can_safely_proceed_with_config_module(config):
            # should display all data that's available instead of just
            # this label
            #
            # and should give
            # user an overide option where they either pick an old config
            # for one time use or just blow out the memory of having used
            # a different config...
            #
            # should also print the checksum itself so they know
            # what they need...
            #
            # perhaps eventually we even put in place some archival support
            # for saving old glade and config files and then code into the
            # the transaction -- hey, code you need to be editable is
            # over here..
            #
            # now hopefully there is no marking of this transaction dirty
            # in this mode and the extra safegaurds we put into
            # MultipageGladeTransaction don't get activated
            self.mainvbox.pack_start(
                Label("out of date configuration. data is read only here for "
                      "the safety of your old information, last adler "
                      "CRC was %s" % self.trans.config_crc_cache ))
        else:
            # if the safety cache was relied on before we need to tell the
            # backend that the transaction is actually dirty,
            # and now that we know that we have a workable config,
            # there's a chance that we'll actually be able to avoid
            # relying on the cache this time
            if self.trans.get_safety_cache_was_used():
                self.change_register_function()

            self.page_label = Label("")
            (x_align, y_align) = self.page_label.get_alignment()
            self.page_label.set_alignment(0.0, y_align)
            self.mainvbox.pack_start(self.page_label, expand=False)

            # establish maincontainer, which is where the actual glade
            # pages are put by attach_current_page
            #
            # The order of placement here is important, we place this
            # after page_label has already been added to main
            # and we also need to do this prior to attach_current_page
            # being called, as it depends on self.maincontainer being
            # 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()

#.........这里部分代码省略.........
开发者ID:paritworkercoop,项目名称:bokeep-mirror,代码行数:103,代码来源:multipageglade.py


注:本文中的gtk.ScrolledWindow.add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。