seed r664 - in trunk: examples libseed
- From: racarr svn gnome org
- To: svn-commits-list gnome org
- Subject: seed r664 - in trunk: examples libseed
- Date: Mon, 5 Jan 2009 11:06:14 +0000 (UTC)
Author: racarr
Date: Mon Jan 5 11:06:14 2009
New Revision: 664
URL: http://svn.gnome.org/viewvc/seed?rev=664&view=rev
Log:
Add a simple GtkTreeView example..and some small changes to make it
work.
Added:
trunk/examples/gtktreeview.js (contents, props changed)
Modified:
trunk/examples/Makefile.am
trunk/libseed/seed-types.c
Modified: trunk/examples/Makefile.am
==============================================================================
--- trunk/examples/Makefile.am (original)
+++ trunk/examples/Makefile.am Mon Jan 5 11:06:14 2009
@@ -8,6 +8,7 @@
examples_DATA = \
actions.js \
Gnio.js \
+ gtktreeview.js \
Gnio-server.js \
clutter-cairo.js \
threaded-repl.js \
@@ -32,6 +33,7 @@
EXTRA_DIST = \
COPYING \
actions.js \
+ gtktreeview.js \
calculator.js \
clutter-cairo.js \
gconf.js \
Added: trunk/examples/gtktreeview.js
==============================================================================
--- (empty file)
+++ trunk/examples/gtktreeview.js Mon Jan 5 11:06:14 2009
@@ -0,0 +1,35 @@
+#!/usr/bin/env seed
+Seed.import_namespace("Gtk");
+
+Gtk.init(null, null);
+
+
+var w = new Gtk.Window();
+var v = new Gtk.TreeView();
+
+var c = new Gtk.TreeViewColumn();
+var cr = new Gtk.CellRendererText();
+c.pack_start(cr);
+c.add_attribute(cr, "text", 0);
+
+v.append_column(c);
+
+var m = new Gtk.ListStore();
+m.set_column_types(1, [GObject.TYPE_STRING]);
+
+var iter = new Gtk.TreeIter();
+m.append(iter);
+m.set_value(iter, 0, "Test 1");
+m.append(iter);
+m.set_value(iter, 0, "Test 2");
+m.append(iter);
+m.set_value(iter, 0, "Hello World!");
+
+//TODO: FIXME: Why does property not work here?
+v.set_model(m);
+w.add(v);
+
+w.show_all();
+w.resize(300, 300);
+
+Gtk.main();
Modified: trunk/libseed/seed-types.c
==============================================================================
--- trunk/libseed/seed-types.c (original)
+++ trunk/libseed/seed-types.c Mon Jan 5 11:06:14 2009
@@ -876,7 +876,7 @@
}
}
switch (JSValueGetType(ctx, val))
- {
+ {
case kJSTypeBoolean:
{
g_value_init(ret, G_TYPE_BOOLEAN);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]