python中forward属性_Python Gtk.STOCK_GO_FORWARD属性代码示例

# 需要导入模块: from gi.repository import Gtk [as 别名]

# 或者: from gi.repository.Gtk import STOCK_GO_FORWARD [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()

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值