tests/enum.vala
[app.Builder.js] / tests / webkit_frame.js
1 //<Script type="text/javascript">
2
3 /**
4  *  Test of web kit inspector.
5  *  create a window + 2 webviews. inside scrolled window.
6  *     load google in first, then hook in the inspector..
7  * 
8  * needs the transfer ownship fixing on return value in  WebKit-1.0.gir
9  * 
10  *  <method name="get_inspector"
11  *             c:identifier="webkit_web_view_get_inspector">
12  *       <return-value transfer-ownership="none">
13  *         <type name="WebInspector" c:type="WebKitWebInspector*"/>
14  *       </return-value>
15  *     </method>
16  *
17  * then compile it..
18  * g-ir-compiler /usr/share/gir-1.0/WebKit-1.0.gir -o /usr/lib/girepository-1.0/WebKit-1.0.typelib 
19  *
20  */
21  
22  
23 Gtk = imports.gi.Gtk;
24 WebKit = imports.gi.WebKit;
25
26 Gtk.init(null,null);
27
28 // build the UI..
29 w = new Gtk.Window.c_new( Gtk.WindowType.TOPLEVEL);
30 v = new Gtk.VBox();
31 s1 = new Gtk.ScrolledWindow();
32 w1 = new WebKit.WebView();
33 s1.add(w1);
34 v.add(s1);
35 w.add(v);
36
37 // enable inspector..
38 // load google on show..
39 w1.signal.show.connect(function() {
40     w1.load_html_string("<body>hello world<iframe width='100' height='100' src='about:blank'></iframe></body>");
41 });
42
43
44 // show and go..
45 w.show_all();
46 Gtk.main();
47
48
49