aboutsummaryrefslogtreecommitdiffstats
path: root/examples/elementary/test_separator.py
blob: cf52e67b743beb2256b53132bbf1dd9dd0c05bda (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
#!/usr/bin/env python
# encoding: utf-8

from efl.evas import EVAS_HINT_EXPAND, EVAS_HINT_FILL, EXPAND_BOTH, FILL_BOTH
from efl import elementary
from efl.elementary.window import StandardWindow
from efl.elementary.box import Box
from efl.elementary.button import Button
from efl.elementary.separator import Separator


def separator_clicked(obj):
    win = StandardWindow("separators", "Separators", autodel=True)
    if obj is None:
        win.callback_delete_request_add(lambda o: elementary.exit())

    bx0 = Box(win, size_hint_weight=EXPAND_BOTH, horizontal=True)
    win.resize_object_add(bx0)
    bx0.show()

    bx = Box(win, size_hint_weight=EXPAND_BOTH)
    bx0.pack_end(bx)
    bx.show()

    bt = Button(win, text="Left upper corner")
    bx.pack_end(bt)
    bt.show()

    sp = Separator(win, horizontal=True)
    bx.pack_end(sp)
    sp.show()

    bt = Button(win, text="Left lower corner", disabled=True)
    bx.pack_end(bt)
    bt.show()

    sp = Separator(win)
    bx0.pack_end(sp)
    sp.show()

    bx = Box(win, size_hint_weight=EXPAND_BOTH)
    bx0.pack_end(bx)
    bx.show()

    bt = Button(win, text="Right upper corner", disabled=True)
    bx.pack_end(bt)
    bt.show()

    sp = Separator(win, horizontal=True)
    bx.pack_end(sp)
    sp.show()

    bt = Button(win, text="Right lower corner")
    bx.pack_end(bt)
    bt.show()

    win.show()


if __name__ == "__main__":

    separator_clicked(None)

    elementary.run()