[seed] Update more examples
- From: Robert Carr <racarr src gnome org>
- To: svn-commits-list gnome org
- Subject: [seed] Update more examples
- Date: Sun, 12 Apr 2009 11:26:49 -0400 (EDT)
commit 03bed9f537d73f4df1f7e318054ed729752cc807
Author: Robert Carr <racarr mireia (none)>
Date: Sun Apr 12 11:26:43 2009 -0400
Update more examples
---
examples/async-quine.js | 6 +++---
examples/gdkpixbufloader.js | 12 ++++++------
examples/gtktreeview.js | 3 ++-
examples/json-packing.js | 2 +-
examples/json-reddit.js | 8 ++++----
examples/ls.js | 2 +-
6 files changed, 17 insertions(+), 16 deletions(-)
diff --git a/examples/async-quine.js b/examples/async-quine.js
index 2d10ebf..0a7c097 100755
--- a/examples/async-quine.js
+++ b/examples/async-quine.js
@@ -1,7 +1,7 @@
#!/usr/bin/env seed
-Seed.import_namespace("GLib");
-Seed.import_namespace("Gio");
+GLib = imports.gi.GLib;
+Gio = imports.gi.Gio;
var file = Gio.file_new_for_path("./async-quine.js");
@@ -10,7 +10,7 @@ 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();
});
diff --git a/examples/gdkpixbufloader.js b/examples/gdkpixbufloader.js
index a629178..36f5e2d 100755
--- a/examples/gdkpixbufloader.js
+++ b/examples/gdkpixbufloader.js
@@ -1,11 +1,11 @@
#!/usr/bin/env seed
-Seed.import_namespace("GLib");
-Seed.import_namespace("Gio");
-Seed.import_namespace("GdkPixbuf");
-Seed.import_namespace("Gtk");
+GLib = imports.gi.GLib;
+Gio = imports.gi.Gio;
+GdkPixbuf = imports.gi.GdkPixbuf;
+Gtk = imports.gi.Gtk;
-var blue_marble =
+var blue_marble =
Gio.file_new_for_uri("http://veimages.gsfc.nasa.gov/7100/world.topo.bathy.200401.3x5400x2700.jpg");
blue_marble.read_async(0, null, function(source, result)
@@ -24,7 +24,7 @@ blue_marble.read_async(0, null, function(source, result)
catch (e)
{
}
-
+
var pixbuf = loader.get_pixbuf();
pixbuf.savev("bluemarble","jpeg");
Seed.quit();
diff --git a/examples/gtktreeview.js b/examples/gtktreeview.js
index d87b230..849f8fb 100755
--- a/examples/gtktreeview.js
+++ b/examples/gtktreeview.js
@@ -1,5 +1,6 @@
#!/usr/bin/env seed
-Seed.import_namespace("Gtk");
+Gtk = imports.gi.Gtk;
+GObject = imports.gi.GObject;
Gtk.init(null, null);
diff --git a/examples/json-packing.js b/examples/json-packing.js
index 5c0b2ee..2237ee9 100755
--- a/examples/json-packing.js
+++ b/examples/json-packing.js
@@ -1,6 +1,6 @@
#!/usr/bin/env seed
-Seed.import_namespace("Gtk");
+Gtk = imports.gi.Gtk;
Gtk.init(null, null);
diff --git a/examples/json-reddit.js b/examples/json-reddit.js
index 6fca1d1..e22964b 100755
--- a/examples/json-reddit.js
+++ b/examples/json-reddit.js
@@ -1,6 +1,6 @@
#!/usr/bin/env seed
-Seed.import_namespace("Gio");
+Gio = imports.gi.Gio;
var redditurl = Gio.file_new_for_uri("http://reddit.com/.json");
var reddit = JSON.parse(redditurl.read().get_contents());
@@ -11,9 +11,9 @@ for (i in stories)
{
var story = stories[i].data;
Seed.print("======");
- Seed.print(story.ups + "/" +
- story.downs + " " +
- story.title + " (" +
+ Seed.print(story.ups + "/" +
+ story.downs + " " +
+ story.title + " (" +
story.domain +")" );
Seed.print(story.author);
}
diff --git a/examples/ls.js b/examples/ls.js
index 2a0103f..0fbf51c 100755
--- a/examples/ls.js
+++ b/examples/ls.js
@@ -1,6 +1,6 @@
#!/usr/bin/env seed
-Seed.import_namespace("Gio");
+Gio = imports.gi.Gio;
// Gio.File is an interface, not an actual instantiable class, so we can not
// construct one with a "path" property. Instead it is necessary to use
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]