seed r131 - trunk/examples
- From: racarr svn gnome org
- To: svn-commits-list gnome org
- Subject: seed r131 - trunk/examples
- Date: Wed, 5 Nov 2008 14:40:57 +0000 (UTC)
Author: racarr
Date: Wed Nov 5 14:40:57 2008
New Revision: 131
URL: http://svn.gnome.org/viewvc/seed?rev=131&view=rev
Log:
Add a JSON packing example. Clean up VTE a little.
Added:
trunk/examples/json-packing.js (contents, props changed)
Modified:
trunk/examples/Makefile.am
trunk/examples/vte-test.js
Modified: trunk/examples/Makefile.am
==============================================================================
--- trunk/examples/Makefile.am (original)
+++ trunk/examples/Makefile.am Wed Nov 5 14:40:57 2008
@@ -9,6 +9,7 @@
clutter.js \
introspect.js \
poppler.js \
+ json-packing.js \
ls.js \
mini-browser.js \
n-oscillator.js \
Added: trunk/examples/json-packing.js
==============================================================================
--- (empty file)
+++ trunk/examples/json-packing.js Wed Nov 5 14:40:57 2008
@@ -0,0 +1,28 @@
+#!/usr/local/bin/seed
+Seed.import_namespace("Gtk");
+Gtk.init(null, null);
+
+label = new Gtk.Label({label: "Hi!"});
+button = new Gtk.Button({label: "Bye"});
+entry = new Gtk.Entry();
+
+packing = [
+ {child: label,
+ fill: false,
+ padding: 10,
+ position: Gtk.PackType.end},
+ {child:button,
+ fill: false,
+ padding: 100,
+ expand: true},
+ {child:entry}
+ ];
+
+window = new Gtk.Window();
+vbox = new Gtk.VBox();
+
+vbox.pack(packing);
+
+window.add(vbox);
+window.show_all();
+Gtk.main();
\ No newline at end of file
Modified: trunk/examples/vte-test.js
==============================================================================
--- trunk/examples/vte-test.js (original)
+++ trunk/examples/vte-test.js Wed Nov 5 14:40:57 2008
@@ -5,6 +5,7 @@
Gtk.init(null, null);
var window = new Gtk.Window();
+var scroll = new Gtk.ScrolledWindow();
var vte = new Vte.Terminal();
vte.fork_command("/bin/bash");
@@ -15,9 +16,16 @@
this.set_title(terminal.get_window_title());
}, window);
-window.add(vte);
+scroll.add(vte);
+scroll.set_policy(Gtk.PolicyType.automatic,
+ Gtk.PolicyType.automatic);
+
+window.add(scroll);
window.show_all();
+window.width_request = 500;
+window.height_request = 400;
+
Gtk.main();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]