Skip to content

Instantly share code, notes, and snippets.

@leedo
Created October 19, 2009 16:33
Show Gist options
  • Save leedo/213500 to your computer and use it in GitHub Desktop.
Save leedo/213500 to your computer and use it in GitHub Desktop.
alice frontend using seed
#!/usr/bin/env seed
Gtk = imports.gi.Gtk;
Glib = imports.gi.GLib;
WebKit = imports.gi.WebKit;
os = imports.os;
Gtk.init(Seed.argv);
window = new Gtk.Window({title: "Alice"});
window.resize(800, 600);
window.signal.hide.connect(Gtk.main_quit);
webview = new WebKit.WebView;
webview.open("http://127.0.0.1:8081/view");
webview.signal.navigation_policy_decision_requested.connect(
function(webview, webframe, request, action, decision, window) {
if (action.get_reason() == WebKit.WebNavigationReason.LINK_CLICKED) {
Glib.spawn_command_line_async("x-www-browser " + request.get_uri());
return true;
}
}
);
window.add(webview);
window.show_all();
Gtk.main();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment