seed r518 - trunk/examples
- From: racarr svn gnome org
- To: svn-commits-list gnome org
- Subject: seed r518 - trunk/examples
- Date: Sat, 20 Dec 2008 08:22:44 +0000 (UTC)
Author: racarr
Date: Sat Dec 20 08:22:44 2008
New Revision: 518
URL: http://svn.gnome.org/viewvc/seed?rev=518&view=rev
Log:
More GTK examples
Added:
trunk/examples/gtkplug.js (contents, props changed)
Modified:
trunk/examples/Makefile.am
Modified: trunk/examples/Makefile.am
==============================================================================
--- trunk/examples/Makefile.am (original)
+++ trunk/examples/Makefile.am Sat Dec 20 08:22:44 2008
@@ -10,6 +10,7 @@
Gnio-server.js \
clutter-cairo.js \
threaded-repl.js \
+ gtkplug.js \
calculator.js \
gconf.js \
video.js \
@@ -40,6 +41,7 @@
introspect.js \
poppler.js \
json-packing.js \
+ gtkplug.js \
ls.js \
n-oscillator.js \
notify-test.js \
Added: trunk/examples/gtkplug.js
==============================================================================
--- (empty file)
+++ trunk/examples/gtkplug.js Sat Dec 20 08:22:44 2008
@@ -0,0 +1,37 @@
+#!/usr/bin/env seed
+Seed.import_namespace("Gtk");
+Seed.import_namespace("Multiprocessing");
+Seed.import_namespace("Gio");
+
+var pipes = new Multiprocessing.Pipe();
+
+var child_pid = Seed.fork();
+
+if (child_pid == 0)
+{
+ Gtk.init(null, null);
+
+ var pipe = pipes[0];
+
+ var id = parseInt(pipe.read());
+
+ var l = new Gtk.Label({label: "Hello GtkPlug World"});
+ var s = Gtk.Plug._new(id);
+
+ s.add(l);
+ s.show_all();
+ Gtk.main();
+}
+
+Gtk.init(null, null);
+var w = new Gtk.Window();
+var s = new Gtk.Socket();
+var pipe = pipes[1];
+
+w.add(s);
+w.show_all();
+
+pipe.write(s.get_id());
+
+Gtk.main();
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]