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


Python Gtk.STOCK_REFRESH属性代码示例

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


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

示例1: update_status_bar

# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import STOCK_REFRESH [as 别名]
def update_status_bar(self):

        if self.funds_error:
            text = "Not enough funds"
        elif self.network.is_connected():
            host, port, _,_,_ = self.network.get_parameters()
            port = int(port)
            height = self.network.get_local_height()
            self.network_button.set_tooltip_text("Connected to %s:%d.\n%d blocks"%(host, port, height))
            if not self.wallet.up_to_date:
                self.status_image.set_from_stock(Gtk.STOCK_REFRESH, Gtk.IconSize.MENU)
                text = "Synchronizing..."
            else:
                self.status_image.set_from_stock(Gtk.STOCK_YES, Gtk.IconSize.MENU)
                c, u = self.wallet.get_balance()
                text =  "Balance: %s "%( format_satoshis(c,False,self.num_zeros) )
                if u: text +=  "[%s unconfirmed]"%( format_satoshis(u,True,self.num_zeros).strip() )
        else:
            self.status_image.set_from_stock(Gtk.STOCK_NO, Gtk.IconSize.MENU)
            self.network_button.set_tooltip_text("Not connected.")
            text = "Not connected"

        self.status_bar.pop(self.context_id) 
        self.status_bar.push(self.context_id, text)

        if self.wallet.up_to_date and self.wallet_updated:
            self.update_history_tab()
            self.update_receiving_tab()
            # addressbook too...
            self.info.set_text( self.network.banner )
            self.wallet_updated = False 
开发者ID:mazaclub,项目名称:encompass,代码行数:33,代码来源:gtk.py

示例2: _define_actions_fw_bw

# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import STOCK_REFRESH [as 别名]
def _define_actions_fw_bw(self):
        """
        prepare the forward and backward buttons.
        add the Backward action to handle the Backward button
        accel doesn't work in webkit and gtkmozembed !
        we must do that ...
        """
        self.back_action = Gtk.ActionGroup(name=self.title + '/Back')
        self.back_action.add_actions([
            ('Back', Gtk.STOCK_GO_BACK, _("_Back"),
             "<ALT>Left", _("Go to the previous page in the history"),
             self.go_back)
            ])
        self._add_action_group(self.back_action)
        # add the Forward action to handle the Forward button
        self.forward_action = Gtk.ActionGroup(name=self.title + '/Forward')
        self.forward_action.add_actions([
            ('Forward', Gtk.STOCK_GO_FORWARD, _("_Forward"),
             "<ALT>Right", _("Go to the next page in the history"),
             self.go_forward)
            ])
        self._add_action_group(self.forward_action)
        # add the Refresh action to handle the Refresh button
        self._add_action('Refresh', Gtk.STOCK_REFRESH, _("_Refresh"),
                          callback=self.refresh,
                          accel="<Ctl>R",
                          tip=_("Stop and reload the page.")) 
开发者ID:gramps-project,项目名称:addons-source,代码行数:29,代码来源:htmlview.py

示例3: __init__

# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import STOCK_REFRESH [as 别名]
def __init__(self, extension, opener, preferences):
		GObject.GObject.__init__(self)
		self.extension = extension # XXX
		self.opener = opener
		self.uistate = extension.uistate
		self.preferences = preferences
		self._close_button = None

		self.iconview = FileBrowserIconView(opener, self.icon_size)
		self.add(ScrolledWindow(self.iconview, shadow=Gtk.ShadowType.NONE))

		self.on_preferences_changed()
		self.preferences.connect('changed', self.on_preferences_changed)

		self.buttonbox = Gtk.VBox()
		self.pack_end(self.buttonbox, False, True, 0)

		open_folder_button = IconButton(Gtk.STOCK_OPEN, relief=False)
		open_folder_button.connect('clicked', self.on_open_folder)
		self.buttonbox.pack_start(open_folder_button, False, True, 0)

		refresh_button = IconButton(Gtk.STOCK_REFRESH, relief=False)
		refresh_button.connect('clicked', lambda o: self.on_refresh_button())
		self.buttonbox.pack_start(refresh_button, False, True, 0)

		zoomin = IconButton(Gtk.STOCK_ZOOM_IN, relief=False)
		zoomout = IconButton(Gtk.STOCK_ZOOM_OUT, relief=False)
		zoomin.connect('clicked', lambda o: self.on_zoom_in())
		zoomout.connect('clicked', lambda o: self.on_zoom_out())
		self.buttonbox.pack_end(zoomout, False, True, 0)
		self.buttonbox.pack_end(zoomin, False, True, 0)
		self.zoomin_button = zoomin
		self.zoomout_button = zoomout

		self.set_icon_size(self.icon_size)

		self.iconview.connect('folder-changed', lambda o: self.update_title()) 
开发者ID:zim-desktop-wiki,项目名称:zim-desktop-wiki,代码行数:39,代码来源:__init__.py

示例4: __init__

# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import STOCK_REFRESH [as 别名]
def __init__(self, url):
        from pychess.System.uistuff import keepWindowSize
        self.window = Gtk.Window()
        keepWindowSize("webkitbrowser", self.window, (800, 600))

        self.vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
        self.window.add(self.vbox)

        self.box = Gtk.Box()

        self.toolbar = Gtk.Toolbar()
        self.box.pack_start(self.toolbar, False, False, 0)

        self.go_back_button = Gtk.ToolButton(stock_id=Gtk.STOCK_GO_BACK)
        self.toolbar.insert(self.go_back_button, -1)

        self.go_forward_button = Gtk.ToolButton(stock_id=Gtk.STOCK_GO_FORWARD)
        self.toolbar.insert(self.go_forward_button, -1)

        self.go_refresh_button = Gtk.ToolButton(stock_id=Gtk.STOCK_REFRESH)
        self.toolbar.insert(self.go_refresh_button, -1)

        self.url = Gtk.Entry()
        self.box.pack_start(self.url, True, True, 0)

        self.search_entry = Gtk.SearchEntry()
        self.box.pack_start(self.search_entry, False, False, 0)

        self.vbox.pack_start(self.box, False, False, 0)

        self.view = WebKit.WebView()
        self.scrolled_window = Gtk.ScrolledWindow()
        self.scrolled_window.add(self.view)

        self.vbox.pack_start(self.scrolled_window, True, True, 0)

        self.window.show_all()

        self.view.connect("load-committed", self.check_buttons)
        self.view.connect("title-changed", self.change_title)

        self.url.connect("activate", self.go)
        self.search_entry.connect("activate", self.search)
        self.go_back_button.connect("clicked", self.go_back)
        self.go_forward_button.connect("clicked", self.go_forward)
        self.go_refresh_button.connect("clicked", self.refresh)

        self.view.open(url)
        self.view.show() 
开发者ID:pychess,项目名称:pychess,代码行数:51,代码来源:WebKitBrowser.py

示例5: __init__

# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import STOCK_REFRESH [as 别名]
def __init__(self, parent, username, cookie, tokens, codeString, vcodetype):
        super().__init__(_('Verification..'), parent, Gtk.DialogFlags.MODAL)

        self.set_default_size(280, 130)
        self.set_border_width(10)
        self.username = username
        self.cookie = cookie
        self.tokens = tokens
        self.codeString = codeString
        self.vcodetype = vcodetype

        box = self.get_content_area()
        box.set_spacing(5)

        self.vcode_img = Gtk.Image()
        box.pack_start(self.vcode_img, True, True, 0)

        button_box = Gtk.Box(spacing=5)
        box.pack_start(button_box, True, True, 0)

        self.vcode_entry = Gtk.Entry()
        self.vcode_entry.connect('activate', self.check_entry)
        button_box.pack_start(self.vcode_entry, True, True, 0)

        if Config.GTK_GE_312:
            vcode_refresh = Widgets.IconButton('view-refresh-symbolic')
        else:
            vcode_refresh = Gtk.Button.new_from_stock(Gtk.STOCK_REFRESH)
        vcode_refresh.props.valign = Gtk.Align.CENTER
        vcode_refresh.connect('clicked', self.on_vcode_refresh_clicked)
        button_box.pack_start(vcode_refresh, False, False, 0)

        # show loading process
        self.loading_spin = Gtk.Spinner()
        self.loading_spin.props.valign = Gtk.Align.CENTER
        button_box.pack_start(self.loading_spin, False, False, 0)

        vcode_confirm = Gtk.Button.new_from_stock(Gtk.STOCK_OK)
        vcode_confirm.connect('clicked', self.on_vcode_confirm_clicked)
        vcode_confirm.props.valign = Gtk.Align.END
        box.pack_start(vcode_confirm, False, False, 10)

        box.show_all()
        self.loading_spin.hide()

        gutil.async_call(auth.get_signin_vcode, cookie, codeString,
                         callback=self.update_img) 
开发者ID:XuShaohua,项目名称:bcloud,代码行数:49,代码来源:SigninDialog.py


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