File: clutter.js

package info (click to toggle)
gjs 1.32.0-5
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 4,436 kB
  • sloc: ansic: 27,721; sh: 11,157; makefile: 203; python: 120; cpp: 49
file content (24 lines) | stat: -rw-r--r-- 513 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const Clutter = imports.gi.Clutter;

Clutter.init(null);

let stage = new Clutter.Stage();

let texture = new Clutter.Texture({ filename: 'test.jpg',
                                    reactive: true });

texture.connect('button-press-event',
                function(o, event) {
                    log('Clicked!');
                    return true;
                });

let color = new Clutter.Color();
color.from_string('Black');

stage.color = color;

stage.add_actor(texture);
stage.show();

Clutter.main();