seed r726 - trunk/tests/javascript
- From: hortont svn gnome org
- To: svn-commits-list gnome org
- Subject: seed r726 - trunk/tests/javascript
- Date: Wed, 14 Jan 2009 07:02:29 +0000 (UTC)
Author: hortont
Date: Wed Jan 14 07:02:29 2009
New Revision: 726
URL: http://svn.gnome.org/viewvc/seed?rev=726&view=rev
Log:
Add test for installed-from-JS signals on GTypes which have arguments.
Added:
trunk/tests/javascript/gtype-signal-args.js (contents, props changed)
Added: trunk/tests/javascript/gtype-signal-args.js
==============================================================================
--- (empty file)
+++ trunk/tests/javascript/gtype-signal-args.js Wed Jan 14 07:02:29 2009
@@ -0,0 +1,33 @@
+#!/usr/bin/env seed
+// Returns: 0
+// STDIN:
+// STDOUT:2 Test\n\[object GtkWindow\]
+// STDERR:
+
+Seed.import_namespace("Gtk");
+Gtk.init(null, null);
+
+HelloWindow = new GType({
+ parent: Gtk.Window.type,
+ name: "HelloWindow",
+ class_init: function(klass, prototype)
+ {
+ var HelloSignalDefinition = {name: "hello",
+ parameters: [GObject.TYPE_INT,
+ GObject.TYPE_STRING],
+ return_type: Gtk.Window.type};
+
+ hello_signal_id = klass.install_signal(HelloSignalDefinition);
+ },
+});
+
+w = new HelloWindow();
+
+w.signal.hello.connect(function(object, number, string)
+ {
+ Seed.print(number + " " + string);
+ return new Gtk.Window()
+ });
+
+Seed.print(w.signal.hello.emit(2, "Test"));
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]