aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorDave Andreoli <dave@gurumeditation.it>2016-08-09 10:19:14 +0200
committerDave Andreoli <dave@gurumeditation.it>2016-08-09 10:19:14 +0200
commit83656bff3302166d4b1b3a338703bbe10920bc74 (patch)
treede7fff375db74b6e8bc8f8d86bf1dd6bd8836e07 /examples
parentNew 1.18 API: elm.Transit.revert() (diff)
downloadpython-efl-83656bff3302166d4b1b3a338703bbe10920bc74.tar.gz
New 1.18 API: elm.Entry.select_region (get + property)
with test
Diffstat (limited to 'examples')
-rw-r--r--examples/elementary/test_entry.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/examples/elementary/test_entry.py b/examples/elementary/test_entry.py
index b4c43bb..f1693b7 100644
--- a/examples/elementary/test_entry.py
+++ b/examples/elementary/test_entry.py
@@ -52,6 +52,12 @@ def my_entry_bt_5(chk):
def my_entry_anchor_test(obj, anchor, en, *args, **kwargs):
en.entry_insert("ANCHOR CLICKED")
+def my_entry_bt_6(bt, en):
+ en.select_region = (3, 10)
+
+def my_entry_bt_7(bt, en):
+ print("Sel region: ", en.select_region)
+
def entry_clicked(obj, item=None):
win = StandardWindow("entry", "Entry", autodel=True)
@@ -108,6 +114,24 @@ def entry_clicked(obj, item=None):
bx.pack_end(bx2)
bx2.show()
+ bx2 = Box(win, horizontal=True, size_hint_weight=EXPAND_HORIZ,
+ size_hint_align=FILL_BOTH)
+
+ bt = Button(win, text="Sel region set", size_hint_weight=EXPAND_HORIZ,
+ size_hint_align=FILL_BOTH)
+ bt.callback_clicked_add(my_entry_bt_6, en)
+ bx2.pack_end(bt)
+ bt.show()
+
+ bt = Button(win, text="Sel region get", size_hint_weight=EXPAND_HORIZ,
+ size_hint_align=FILL_BOTH)
+ bt.callback_clicked_add(my_entry_bt_7, en)
+ bx2.pack_end(bt)
+ bt.show()
+
+ bx.pack_end(bx2)
+ bx2.show()
+
en.focus_set(True)
win.show()