Skip to content

Instantly share code, notes, and snippets.

@aeroaks
Created September 4, 2014 09:14
Show Gist options
  • Save aeroaks/797d33e07419fbb87e34 to your computer and use it in GitHub Desktop.
Save aeroaks/797d33e07419fbb87e34 to your computer and use it in GitHub Desktop.
GTK Webkit2 Browser - simple single window
from gi.repository import Gtk
from gi.repository import WebKit2
# initialize WebView
view = WebKit2.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.load_uri("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