summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Andreoli <dave@gurumeditation.it>2015-12-20 12:23:34 +0100
committerDave Andreoli <dave@gurumeditation.it>2015-12-20 12:25:22 +0100
commit06cb7ad59844dc3852686cc0931dc747b3d229ea (patch)
tree7acc75f6a8057d5658434fdee4868788ae5c445c
parent75fa5ff25600005dec7ae002b33b4f9f12171c9c (diff)
More tests on GenlistItem show/bring_in
-rw-r--r--examples/elementary/test_genlist_1.py69
1 files changed, 52 insertions, 17 deletions
diff --git a/examples/elementary/test_genlist_1.py b/examples/elementary/test_genlist_1.py
index a7e0cd3..5d9f479 100644
--- a/examples/elementary/test_genlist_1.py
+++ b/examples/elementary/test_genlist_1.py
@@ -110,19 +110,6 @@ def test_genlist_1(parent):
110 win.resize_object_add(over) 110 win.resize_object_add(over)
111 over.show() 111 over.show()
112 112
113 # buttons
114 vbox = Box(win, horizontal=True)
115 box.pack_end(vbox)
116 vbox.show()
117
118 bt_50 = Button(win, text="Go to 50")
119 vbox.pack_end(bt_50)
120 bt_50.show()
121
122 bt_1500 = Button(win, text="Go to 1500")
123 vbox.pack_end(bt_1500)
124 bt_1500.show()
125
126 # populate the genlist 113 # populate the genlist
127 for i in range(0, 2000): 114 for i in range(0, 2000):
128 115
@@ -133,10 +120,58 @@ def test_genlist_1(parent):
133 item = gl.item_append(itc2, i, func=item_selected_cb) 120 item = gl.item_append(itc2, i, func=item_selected_cb)
134 item.tooltip_content_cb_set(tooltip_content_cb) 121 item.tooltip_content_cb_set(tooltip_content_cb)
135 122
136 if i == 50: 123 if i == 50: it_50 = item
137 bt_50.callback_clicked_add(lambda bt, it: it.bring_in(), item) 124 elif i == 1500: it_1500 = item
138 elif i == 1500: 125
139 bt_1500.callback_clicked_add(lambda bt, it: it.bring_in(), item) 126 # item 50 buttons
127 hbox = Box(win, horizontal=True)
128 box.pack_end(hbox)
129 hbox.show()
130
131 bt = Button(win, text="Show 50 (IN)")
132 bt.callback_clicked_add(lambda bt: it_50.show(elm.ELM_GENLIST_ITEM_SCROLLTO_IN))
133 hbox.pack_end(bt)
134 bt.show()
135
136 bt = Button(win, text="Show 50 (TOP)")
137 bt.callback_clicked_add(lambda bt: it_50.show(elm.ELM_GENLIST_ITEM_SCROLLTO_TOP))
138 hbox.pack_end(bt)
139 bt.show()
140
141 bt = Button(win, text="Show 50 (MID)")
142 bt.callback_clicked_add(lambda bt: it_50.show(elm.ELM_GENLIST_ITEM_SCROLLTO_MIDDLE))
143 hbox.pack_end(bt)
144 bt.show()
145
146 bt = Button(win, text="Bring 50 (IN)")
147 bt.callback_clicked_add(lambda bt: it_50.bring_in(elm.ELM_GENLIST_ITEM_SCROLLTO_IN))
148 hbox.pack_end(bt)
149 bt.show()
150
151 bt = Button(win, text="Bring 50 (TOP)")
152 bt.callback_clicked_add(lambda bt: it_50.bring_in(elm.ELM_GENLIST_ITEM_SCROLLTO_TOP))
153 hbox.pack_end(bt)
154 bt.show()
155
156 bt = Button(win, text="Bring 50 (MID)")
157 bt.callback_clicked_add(lambda bt: it_50.bring_in(elm.ELM_GENLIST_ITEM_SCROLLTO_MIDDLE))
158 hbox.pack_end(bt)
159 bt.show()
160
161 # item 1500 buttons
162 hbox = Box(win, horizontal=True)
163 box.pack_end(hbox)
164 hbox.show()
165
166 bt = Button(win, text="Show 1500 (IN)")
167 bt.callback_clicked_add(lambda bt: it_1500.show())
168 hbox.pack_end(bt)
169 bt.show()
170
171 bt = Button(win, text="Bring 1500 (IN)")
172 bt.callback_clicked_add(lambda bt: it_1500.bring_in())
173 hbox.pack_end(bt)
174 bt.show()
140 175
141 # show the window 176 # show the window
142 win.show() 177 win.show()