1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
efl = require('efl');
elm = require('elm');
win = new elm.Elm.WinStandard(null);
win.setTitle("Bg Plain");
win.setAutohide(true);
bg = new elm.Elm.Bg(win);
bg.setSizeHintWeight(1.0, 1.0);
win.resizeObjectAdd(bg);
bg.setVisible(true);
label1 = new elm.Elm.Label(win);
label1.setText(null, "Bubble with no icon, info or label");
label1.setVisible(true);
console.log(efl);
icon = new efl.Evas.Rectangle(win);
icon.setColor( 0, 0, 255, 255);
icon.setVisible(true);
bubble1 = new elm.Elm.Bubble(win);
bubble1.contentSet("icon", icon);
bubble1.setText("info", "INFO");
bubble1.setText(null, "LABEL");
bubble1.contentSet(null, label1);
bubble1.setSize(300, 100);
bubble1.setVisible(true);
corner = 0;
bubble1.on('clicked',
function()
{
++corner;
if (corner > 3)
bubble1.pos_set(corner = 0);
else
bubble1.pos_set(corner);
});
label2 = new elm.Elm.Label(win);
label2.setText(null, "Bubble with no icon, info or label");
label2.setVisible(true);
bubble2 = new elm.Elm.Bubble(win);
bubble2.contentSet(null, label2);
bubble2.setSize(200, 50);
bubble2.setPosition(0, 110);
bubble2.setVisible(true);
win.setSize(300, 200);
win.setVisible(true);
|