seed r775 - trunk/examples
- From: racarr svn gnome org
- To: svn-commits-list gnome org
- Subject: seed r775 - trunk/examples
- Date: Tue, 20 Jan 2009 18:33:57 +0000 (UTC)
Author: racarr
Date: Tue Jan 20 18:33:57 2009
New Revision: 775
URL: http://svn.gnome.org/viewvc/seed?rev=775&view=rev
Log:
Add async quine example
Added:
trunk/examples/async-quine.js (contents, props changed)
Modified:
trunk/examples/Makefile.am
Modified: trunk/examples/Makefile.am
==============================================================================
--- trunk/examples/Makefile.am (original)
+++ trunk/examples/Makefile.am Tue Jan 20 18:33:57 2009
@@ -12,6 +12,7 @@
actions.js \
Gnio.js \
gtktreeview.js \
+ async-quine.js \
clutter-cogl.js \
Gnio-server.js \
clutter-cairo.js \
@@ -43,6 +44,7 @@
gtktreeview.js \
calculator.js \
clutter-cairo.js \
+ async-quine.js \
gconf.js \
video.js \
accelgroup.js \
Added: trunk/examples/async-quine.js
==============================================================================
--- (empty file)
+++ trunk/examples/async-quine.js Tue Jan 20 18:33:57 2009
@@ -0,0 +1,19 @@
+#!/usr/local/bin/seed
+Seed.import_namespace("GLib");
+Seed.import_namespace("Gio");
+
+
+var file = Gio.file_new_for_path("./async-quine.js");
+
+file.read_async(0, null, function(source, result)
+ {
+ var stream = source.read_finish(result);
+ var dstream = new Gio.DataInputStream.c_new(stream);
+ var data = dstream.read_until("", 0);
+
+ Seed.print(data);
+ Seed.quit();
+ });
+
+var loop = GLib.main_loop_new();
+GLib.main_loop_run(loop);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]