Fix #5560 - Gitlive - branching wip
[gitlive] / old_seed_version / Browser / main.js
1 #!/usr/bin/env seed
2
3 // this appears to leak memory badly.. - actually seed+webkit is a bit of a mess...
4 // and probably needs to be restarted every day.. 
5
6
7 Gtk = imports.gi.Gtk;
8 WebKit = imports.gi.WebKit;
9 Hotkey = imports.gi.GtkHotkey;
10
11 Gtk.init(Seed.argv);
12
13
14 Browser = {
15     Settings : imports.Settings,
16     View : imports.View.Browser.View,
17     Tab : imports.Tab.Browser.Tab
18 };
19
20  
21  
22
23 window = new Gtk.Window({title: "Browser"});
24 window.resize(800, 600);
25 window.signal.destroy.connect(Gtk.main_quit);
26
27  var new_tab = new Browser.Tab();
28 new_tab.get_web_view().browse(Browser.Settings.home_page);
29 window.add(new_tab);
30
31 var state = false;
32 //window.show_all();
33 //window.hide();
34 //window.fullscreen();
35   
36     var hot = new Hotkey.Info.c_new("gtkhotkey-test", "gtkhotkey-test-key","<Control>Escape" );  
37         
38         //g_signal_connect (hot, "notify::bound", G_CALLBACK(hotkey_bound_cb), NULL);
39         //hot.bind();
40         //error = NULL;
41     var x = hot.bind();
42     print("BIND RETURNED" + x);
43         //gtk_hotkey_info_bind (hot, &error);
44         hot.signal.activated.connect(function ( ) {
45          
46         if (!state) {
47             window.show_all();
48             //GLib.timeout_add(GLib.PRIORITY_LOW, 500, function() {
49                  window.fullscreen();
50                 window.grab_focus();
51                 window.set_keep_above(true);
52             //});    
53             
54         } else {
55             window.unfullscreen();
56              window.set_keep_above(false);
57           window.hide();
58         }
59         state= !state;
60         print ("GOT hotkey test")
61         
62     }); 
63  
64
65 Gtk.main();