aboutsummaryrefslogtreecommitdiffstats
path: root/examples/evas_elem_test.py
blob: 62d1a14f1b47353224c840e51f449e9d9298dc70 (plain) (blame)
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
65
66
# -*- coding: UTF-8 -*-
import sys

from eorepo.evas_elem_py import elm_init, elm_run
#from eobase import EoBase
#from evas_lib.py.evas_l import Evas, EvasObjectRectangle, EvasObjectLine
from eorepo.evas_elem_py import ElmWin, ElmBg, ElmBox, ElmButton

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

w1 = ElmWin(None, "my win name", 0)
w1.elm_obj_win_title_set("first_title")
t = w1.elm_obj_win_title_get()
print "title:", t
w1.evas_obj_size_set(370, 350)
xx,yy = w1.evas_obj_size_get()
print "size : " ,  xx, yy
w1.evas_obj_visibility_set(1)
v = w1.evas_obj_visibility_get()
print "v=", v

bg = ElmBg(w1)
bg.evas_obj_size_hint_weight_set(1.0, 1.0)
w1.elm_obj_win_resize_object_add(bg)
bg.evas_obj_visibility_set(1)


box = ElmBox(w1)
box.evas_obj_size_hint_weight_set(1.0, 1.0)
w1.elm_obj_win_resize_object_add(box)
box.evas_obj_visibility_set(1)

but = ElmButton(w1)
box.elm_obj_box_pack_end(but)
but.evas_obj_visibility_set(1)
but.evas_obj_color_set(255, 255, 0, 255)
but.elm_wdg_text_part_set(None, "Button")
but.evas_obj_size_set(100, 30)

d = w1.elm_obj_win_screen_dpi_get()
print d
d = w1.elm_obj_win_role_get()
print d
#d = w1.fullscreen_set(1)


elm_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 "=================="
"""