Created
August 10, 2011 00:18
-
-
Save davidboy/1135605 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Gtk; | |
using WebKit; | |
public class CatbirdWindow : Window { | |
private WebView web_view; | |
public CatbirdWindow () { | |
this.title = "Catbird"; | |
set_default_size (800, 600); | |
create_widgets (); | |
connect_signals (); | |
} | |
private void create_widgets () { | |
this.web_view = new WebView (); | |
var scrolled_window = new ScrolledWindow (null, null); | |
scrolled_window.set_policy (PolicyType.AUTOMATIC, PolicyType.AUTOMATIC); | |
scrolled_window.add (this.web_view); | |
add (scrolled_window); | |
} | |
private void connect_signals () { | |
this.destroy.connect (Gtk.main_quit); | |
this.web_view.load_error.connect ((view, frame, uri, error) => { | |
Thread.usleep (200000); | |
this.web_view.load_uri ("http://localhost:3000"); | |
return true; | |
}); | |
} | |
public void run () { | |
show_all (); | |
this.web_view.open ("http://localhost:3000"); | |
} | |
public static int main (string[] args) { | |
Gtk.init (ref args); | |
var catbird = new CatbirdWindow (); | |
catbird.run (); | |
Gtk.main (); | |
return 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment