Skip to content

Instantly share code, notes, and snippets.

@aeroaks
Last active August 29, 2015 14:06
Show Gist options
  • Save aeroaks/40d91863e420c7b74b1b to your computer and use it in GitHub Desktop.
Save aeroaks/40d91863e420c7b74b1b to your computer and use it in GitHub Desktop.
GTK Webkit Browser - simple single window
from gi.repository import Gtk
from gi.repository import WebKit
# initialize WebView
view = WebKit.WebView()
# initialize Scrolled Window
sw = Gtk.ScrolledWindow()
sw.add(view)
# initialize GTK Window
win = Gtk.Window()
# destroy signal - to terminate the program neatly
win.connect("destroy", Gtk.main_quit)
win.add(sw)
win.show_all()
# open url
view.open("http://en.wikipedia.org/")
# Start Window
Gtk.main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment