summaryrefslogtreecommitdiff
path: root/examples/evas_elem_test.py
blob: efd8eb42bd5770919f615dc7f6a1bedbe6775255 (plain)
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
55
56
57
58
59
60
61
62
63
64
# -*- coding: UTF-8 -*-
import sys

from base.eodefault import py_elm_init, elem_run
#from eobase import EoBase
#from evas_lib.py.evas_l import Evas, EvasObjectRectangle, EvasObjectLine
from evas_elem_l.py.evas_elem_py import ElmWin, ElmBg, ElmBox, ElmButton

print "Initializing Elementary..."
print "Init res:", py_elm_init(sys.argv)
print ""

w1 = ElmWin(None, "my win name", 0)
w1.title_set("first_title")
t = w1.title_get()
print "title:", t
w1.size_set(370, 350)
xx,yy = w1.size_get()
print "size : " ,  xx, yy
w1.visibility_set(1)
v = w1.visibility_get()
print "v=", v

bg = ElmBg(w1)
bg.size_hint_weight_set(1.0, 1.0)
w1.resize_object_add(bg)
bg.visibility_set(1)


box = ElmBox(w1)
box.size_hint_weight_set(1.0, 1.0)
w1.resize_object_add(box)
box.visibility_set(1)

but = ElmButton(w1)
#but.text_set("Button")
box.pack_end(but)
but.visibility_set(1)

d = w1.screen_dpi_get()
print d
d = w1.role_get()
print d
#d = w1.fullscreen_set(1)


elem_run()

"""
ev = Evas(None)
rect = EvasObjectRectangle(ev)
line = EvasObjectLine(ev)

rect.color_set(255, 55, 0, 255)
r, g, b, a = rect.color_get()
print "%d %d %d %d"%(r, g, b, a)
print "=================="

line.xy_set(0, 0, 10, 20)
r, g, b, a = line.xy_get()
print "%d %d %d %d"%(r, g, b, a)
print "=================="
"""