/+junk/gjs_values

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/%2Bjunk/gjs_values

« back to all changes in this revision

Viewing changes to main.js

  • Committer: Gustav Hartvigsson
  • Date: 2014-11-23 18:35:33 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20141123183533-jey6hl523m2018fj
* got the signaling working... I think.
* Values is no longer a sub class of GObject, this to avoid the GObject
  properties handler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
imports.searchPath.unshift('.');
1
2
const Lang = imports.lang;
2
3
 
3
4
const Values = imports.values;
4
5
 
5
6
function main (argv) {
6
 
  
 
7
  var v = new Values.Values ({tellers: ["hello", "world"], domain: "Sweden"});
 
8
  
 
9
  v.listen ("hello", function () {
 
10
    print ("Hello");
 
11
  });
 
12
  v.listen ("hello", function () {
 
13
    print ("Hello again!");
 
14
  });
 
15
  
 
16
  v.listen ("world", function () {
 
17
    print ("world");
 
18
  });
 
19
  v.listen ("world", function () {
 
20
    print ("World again!");
 
21
  });
 
22
  
 
23
  v.tell ("hello");
 
24
  v.tell ("world");
 
25
  
 
26
  print ();
7
27
}
8
28
 
9
29
main (ARGV);