stop using deprecated calls.
[framework/uifw/elementary.git] / src / bin / test_tooltip.c
1 #include <Elementary.h>
2 #ifdef HAVE_CONFIG_H
3 # include "elementary_config.h"
4 #endif
5 #ifndef ELM_LIB_QUICKLAUNCH
6
7 typedef struct _Testitem
8 {
9    Elm_Gengrid_Item *item;
10    const char       *path;
11    int               mode;
12    int               onoff;
13 } Testitem;
14
15 static Elm_Gengrid_Item_Class gic;
16
17 char *
18 grdt_lbl_get(void            *data,
19              Evas_Object *obj __UNUSED__,
20              const char *part __UNUSED__)
21 {
22    const Testitem *ti = data;
23    char buf[256];
24    snprintf(buf, sizeof(buf), "Photo %s", ti->path);
25    return strdup(buf);
26 }
27
28 Evas_Object *
29 grdt_content_get(void        *data,
30               Evas_Object *obj,
31               const char  *part)
32 {
33    const Testitem *ti = data;
34    if (!strcmp(part, "elm.swallow.icon"))
35      {
36         Evas_Object *icon = elm_bg_add(obj);
37         elm_bg_file_set(icon, ti->path, NULL);
38         evas_object_size_hint_aspect_set(icon,
39                                          EVAS_ASPECT_CONTROL_VERTICAL,
40                                          1, 1);
41         evas_object_show(icon);
42         return icon;
43      }
44    return NULL;
45 }
46
47 static Elm_Genlist_Item_Class itct;
48
49 static void
50 gltt_exp(void *data       __UNUSED__,
51          Evas_Object *obj __UNUSED__,
52          void            *event_info)
53 {
54    Elm_Genlist_Item *it = event_info;
55    Evas_Object *gl = elm_genlist_item_genlist_get(it);
56    int val = (int)(long)elm_genlist_item_data_get(it);
57    Elm_Genlist_Item *it1, *it2, *it3;
58
59    val *= 10;
60    it1 = elm_genlist_item_append(gl, &itct, (void *)(long)(val + 1), it,
61                                  ELM_GENLIST_ITEM_NONE, NULL, NULL);
62    it2 = elm_genlist_item_append(gl, &itct, (void *)(long)(val + 2), it,
63                                  ELM_GENLIST_ITEM_NONE, NULL, NULL);
64    it3 = elm_genlist_item_append(gl, &itct, (void *)(long)(val + 3), it,
65                                  ELM_GENLIST_ITEM_SUBITEMS, NULL, NULL);
66
67    elm_genlist_item_tooltip_text_set(it1, "Testing A");
68    elm_genlist_item_tooltip_text_set(it2, "Testing B");
69    elm_genlist_item_tooltip_text_set(it3, "Testing C");
70 }
71
72 static void
73 gltt_con(void *data       __UNUSED__,
74          Evas_Object *obj __UNUSED__,
75          void            *event_info)
76 {
77    Elm_Genlist_Item *it = event_info;
78    elm_genlist_item_subitems_clear(it);
79 }
80
81 static void
82 gltt_exp_req(void *data       __UNUSED__,
83              Evas_Object *obj __UNUSED__,
84              void            *event_info)
85 {
86    Elm_Genlist_Item *it = event_info;
87    elm_genlist_item_expanded_set(it, 1);
88 }
89
90 static void
91 gltt_con_req(void *data       __UNUSED__,
92              Evas_Object *obj __UNUSED__,
93              void            *event_info)
94 {
95    Elm_Genlist_Item *it = event_info;
96    elm_genlist_item_expanded_set(it, 0);
97 }
98
99 char *
100 gltt_text_get(void            *data,
101                Evas_Object *obj __UNUSED__,
102                const char *part __UNUSED__)
103 {
104    char buf[256];
105    snprintf(buf, sizeof(buf), "Item mode %i", (int)(long)data);
106    return strdup(buf);
107 }
108
109 static Evas_Object *
110 _tt_item_icon(void *data   __UNUSED__,
111               Evas_Object *obj __UNUSED__,
112               Evas_Object *tt,
113               void *item   __UNUSED__)
114 {
115    Evas_Object *ic = elm_icon_add(tt);
116    char buf[PATH_MAX];
117    snprintf(buf, sizeof(buf), "%s/images/logo_small.png",
118             elm_app_data_dir_get());
119    elm_icon_file_set(ic, buf, NULL);
120    elm_icon_scale_set(ic, 0, 0);
121    evas_object_resize(ic, 64, 64);
122    return ic;
123 }
124
125 static Evas_Object *
126 _tt_item_icon2(void *data   __UNUSED__,
127               Evas_Object *obj __UNUSED__,
128               Evas_Object *tt,
129               void *item   __UNUSED__)
130 {
131    Evas_Object *ic = elm_icon_add(tt);
132    char buf[PATH_MAX];
133    snprintf(buf, sizeof(buf), "%s/images/logo.png", elm_app_data_dir_get());
134    elm_icon_file_set(ic, buf, NULL);
135    elm_icon_scale_set(ic, 0, 0);
136    return ic;
137 }
138
139 static Evas_Object *
140 _tt_item_icon3(void *data   __UNUSED__,
141               Evas_Object *obj __UNUSED__,
142               Evas_Object *tt,
143               void *item   __UNUSED__)
144 {
145    int w, h, sw, sh;
146    Evas_Object *ic = elm_icon_add(tt);
147
148    char buf[PATH_MAX];
149    snprintf(buf, sizeof(buf), "%s/images/insanely_huge_test_image.jpg", elm_app_data_dir_get());
150    elm_icon_file_set(ic, buf, NULL);
151    elm_icon_size_get(ic, &w, &h);
152    elm_win_screen_size_get(tt, NULL, NULL, &sw, &sh);
153    if ((w > sw) || (h > sh))
154      {
155         float sc = 0;
156         if ((float)w / (float)sw >= 0.8)
157           sc = ((float)sw * 0.8) / (float)w;
158         else if ((float)h / (float)sh >= 0.8)
159           sc = ((float)sh * 0.8) / (float)h;
160         if (sc) elm_object_scale_set(ic, sc);
161      }
162    return ic;
163 }
164
165 static Evas_Object *
166 _tt_item_label(void *data   __UNUSED__,
167               Evas_Object *obj __UNUSED__,
168               Evas_Object *tt,
169               void *item   __UNUSED__)
170 {
171    Evas_Object *l = elm_label_add(tt);
172    elm_object_text_set(l, "Something useful here?<ps/>"
173                           "No probably not, but this is a super long label<ps/>"
174                           "which probably breaks on your system, now doesn't it?<ps/>"
175                           "Yeah, I thought so.");
176    elm_label_line_wrap_set(l, ELM_WRAP_MIXED);
177    return l;
178 }
179
180 static void
181 _tt_item_icon_del(void            *data,
182                   Evas_Object *obj __UNUSED__,
183                   void            *event_info)
184 {
185    // test to check for del_cb behavior!
186    printf("_tt_icon_del: data=%ld (== 456?), event_info=%p\n",
187           (long)data, event_info);
188 }
189
190 static void
191 _tt_text_replace(void *data       __UNUSED__,
192                  Evas_Object     *obj,
193                  void *event_info __UNUSED__)
194 {
195    static int count = 0;
196    char buf[64];
197    snprintf(buf, sizeof(buf), "count=%d", count);
198    count++;
199    elm_object_tooltip_text_set(obj, buf);
200 }
201
202 static void
203 _tt_timer_del(void *data       __UNUSED__,
204               Evas *e          __UNUSED__,
205               Evas_Object     *obj,
206               void *event_info __UNUSED__)
207 {
208    Ecore_Timer *timer = evas_object_data_del(obj, "test-timer");
209    if (!timer) return;
210    ecore_timer_del(timer);
211 }
212
213 static Eina_Bool
214 _tt_text_replace_timer_cb(void *data)
215 {
216    _tt_text_replace(NULL, data, NULL);
217    return EINA_TRUE;
218 }
219
220 static void
221 _tt_text_replace_timed(void *data       __UNUSED__,
222                        Evas_Object     *obj,
223                        void *event_info __UNUSED__)
224 {
225    Ecore_Timer *timer = evas_object_data_get(obj, "test-timer");
226    if (timer)
227      {
228         ecore_timer_del(timer);
229         evas_object_data_del(obj, "test-timer");
230         elm_object_text_set(obj, "Simple text tooltip, click to start"
231                                   " changed timed");
232         return;
233      }
234
235    timer = ecore_timer_add(1.5, _tt_text_replace_timer_cb, obj);
236    evas_object_data_set(obj, "test-timer", timer);
237    elm_object_text_set(obj, "Simple text tooltip, click to stop changed"
238                              " timed");
239 }
240
241 static Evas_Object *
242 _tt_icon(void *data   __UNUSED__,
243          Evas_Object *obj __UNUSED__,
244          Evas_Object *tt)
245 {
246    Evas_Object *ic = elm_icon_add(tt);
247    char buf[PATH_MAX];
248    snprintf(buf, sizeof(buf), "%s/images/logo_small.png",
249             elm_app_data_dir_get());
250    elm_icon_file_set(ic, buf, NULL);
251    elm_icon_scale_set(ic, 0, 0);
252    evas_object_resize(ic, 64, 64);
253    return ic;
254 }
255
256 static Evas_Object *
257 _tt_icon2(void *data   __UNUSED__,
258           Evas_Object *obj __UNUSED__,
259           Evas_Object *tt)
260 {
261    Evas_Object *ic = elm_icon_add(tt);
262    char buf[PATH_MAX];
263    snprintf(buf, sizeof(buf), "%s/images/icon_00.png", elm_app_data_dir_get());
264    elm_icon_file_set(ic, buf, NULL);
265    elm_icon_scale_set(ic, 0, 0);
266    evas_object_resize(ic, 64, 64);
267    return ic;
268 }
269
270 static void
271 _tt_icon_del(void            *data,
272              Evas_Object *obj __UNUSED__,
273              void            *event_info)
274 {
275    // test to check for del_cb behavior!
276    printf("_tt_icon_del: data=%ld (== 123?), event_info=%p\n",
277           (long)data, event_info);
278 }
279
280 static Eina_Bool
281 _tt_icon_replace_timer_cb(void *data)
282 {
283    static int current = 0;
284
285    elm_object_tooltip_content_cb_set
286      (data, current ? _tt_icon2 : _tt_icon, NULL, NULL);
287
288    current = !current;
289    return EINA_TRUE;
290 }
291
292 static void
293 _tt_icon_replace_timed(void *data       __UNUSED__,
294                        Evas_Object     *obj,
295                        void *event_info __UNUSED__)
296 {
297    Ecore_Timer *timer = evas_object_data_get(obj, "test-timer");
298    if (timer)
299      {
300         ecore_timer_del(timer);
301         evas_object_data_del(obj, "test-timer");
302         elm_object_text_set(obj, "Icon tooltip, click to start changed"
303                                   " timed");
304         return;
305      }
306
307    timer = ecore_timer_add(1.5, _tt_icon_replace_timer_cb, obj);
308    evas_object_data_set(obj, "test-timer", timer);
309    elm_object_text_set(obj, "Icon tooltip, click to stop changed timed");
310 }
311
312 static Eina_Bool
313 _tt_style_replace_timer_cb(void *data)
314 {
315    static int current = 0;
316    elm_object_tooltip_style_set(data, current ? NULL : "transparent");
317    current = !current;
318    return EINA_TRUE;
319 }
320
321 static void
322 _tt_style_replace_timed(void *data       __UNUSED__,
323                         Evas_Object     *obj,
324                         void *event_info __UNUSED__)
325 {
326    Ecore_Timer *timer = evas_object_data_get(obj, "test-timer");
327    if (timer)
328      {
329         ecore_timer_del(timer);
330         evas_object_data_del(obj, "test-timer");
331         elm_object_text_set(obj, "Icon tooltip style, click to start"
332                                   " changed timed");
333         return;
334      }
335
336    timer = ecore_timer_add(1.5, _tt_style_replace_timer_cb, obj);
337    evas_object_data_set(obj, "test-timer", timer);
338    elm_object_text_set(obj, "Icon tooltip style, click to stop changed"
339                              " timed");
340 }
341
342 static void
343 _tt_visible_lock_toggle(void *data       __UNUSED__,
344                         Evas_Object     *obj,
345                         void *event_info __UNUSED__)
346 {
347    static int locked = 0;
348
349    locked = !locked;
350    if (locked)
351      {
352         elm_object_text_set(obj, "Locked tooltip visibility");
353         elm_object_tooltip_text_set(obj, "This tooltip is locked"
354                                          " visible,<br/> click the button"
355                                          " to unlock!");
356         elm_object_tooltip_show(obj);
357      }
358    else
359      {
360         elm_object_text_set(obj, "Unlocked tooltip visibility");
361         elm_object_tooltip_text_set(obj, "This tooltip is unlocked"
362                                          " visible,<br/> click the button"
363                                          " to lock!");
364         elm_object_tooltip_hide(obj);
365      }
366 }
367
368 void
369 test_tooltip(void *data       __UNUSED__,
370              Evas_Object *obj __UNUSED__,
371              void *event_info __UNUSED__)
372 {
373    Evas_Object *win, *bg, *bx, *tb, *bt, *se, *lst;
374    Elm_Object_Item *tb_it;
375    Elm_List_Item *li;
376
377    win = elm_win_add(NULL, "tooltip", ELM_WIN_BASIC);
378    elm_win_title_set(win, "Tooltip");
379    elm_win_autodel_set(win, EINA_TRUE);
380
381    bg = elm_bg_add(win);
382    elm_win_resize_object_add(win, bg);
383    evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND,
384                                     EVAS_HINT_EXPAND);
385    evas_object_show(bg);
386
387    bx = elm_box_add(win);
388    evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND,
389                                     EVAS_HINT_EXPAND);
390    elm_win_resize_object_add(win, bx);
391    evas_object_show(bx);
392
393    tb = elm_toolbar_add(win);
394    elm_toolbar_homogeneous_set(tb, 0);
395    evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, 0.0);
396    evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, 0.0);
397    elm_box_pack_end(bx, tb);
398    evas_object_show(tb);
399
400    tb_it = elm_toolbar_item_append(tb, NULL, "Open", NULL, NULL);
401    elm_toolbar_item_tooltip_text_set(tb_it, "Opens a file");
402
403    tb_it = elm_toolbar_item_append(tb, NULL, "Icon", NULL, NULL);
404    elm_toolbar_item_tooltip_content_cb_set
405      (tb_it, _tt_item_icon, (void *)456L, _tt_item_icon_del);
406    elm_toolbar_item_tooltip_style_set(tb_it, "transparent");
407
408    bt = elm_button_add(win);
409    elm_object_text_set(bt, "Simple text tooltip");
410    elm_object_tooltip_text_set(bt, "Simple text tooltip");
411    elm_box_pack_end(bx, bt);
412    evas_object_show(bt);
413
414    bt = elm_button_add(win);
415    elm_object_text_set(bt, "Simple text tooltip, click to change");
416    elm_object_tooltip_text_set(bt, "Initial");
417    evas_object_smart_callback_add(bt, "clicked", _tt_text_replace, NULL);
418    elm_box_pack_end(bx, bt);
419    evas_object_show(bt);
420
421    bt = elm_button_add(win);
422    elm_object_text_set(bt, "Simple text tooltip, click to start"
423                             " changed timed");
424    elm_object_tooltip_text_set(bt, "Initial");
425    evas_object_smart_callback_add(bt, "clicked", _tt_text_replace_timed,
426                                   NULL);
427    elm_box_pack_end(bx, bt);
428    evas_object_show(bt);
429    evas_object_event_callback_add(bt, EVAS_CALLBACK_DEL, _tt_timer_del,
430                                   NULL);
431
432    bt = elm_button_add(win);
433    elm_object_text_set(bt, "Icon tooltip");
434    elm_object_tooltip_content_cb_set(bt, _tt_icon, (void *)123L,
435                                      _tt_icon_del);
436    elm_box_pack_end(bx, bt);
437    evas_object_show(bt);
438
439    bt = elm_button_add(win);
440    elm_object_text_set(bt, "Icon tooltip, click to start changed timed");
441    elm_object_tooltip_content_cb_set(bt, _tt_icon, NULL, NULL);
442    evas_object_smart_callback_add(bt, "clicked", _tt_icon_replace_timed,
443                                   NULL);
444    elm_box_pack_end(bx, bt);
445    evas_object_show(bt);
446    evas_object_event_callback_add(bt, EVAS_CALLBACK_DEL, _tt_timer_del,
447                                   NULL);
448
449    bt = elm_button_add(win);
450    elm_object_text_set(bt, "Transparent Icon tooltip");
451    elm_object_tooltip_content_cb_set(bt, _tt_icon, NULL, NULL);
452    elm_object_tooltip_style_set(bt, "transparent");
453    elm_box_pack_end(bx, bt);
454    evas_object_show(bt);
455
456    bt = elm_button_add(win);
457    elm_object_text_set(bt, "Icon tooltip style, click to start changed"
458                             " timed");
459    elm_object_tooltip_content_cb_set(bt, _tt_icon, NULL, NULL);
460    evas_object_smart_callback_add(bt, "clicked", _tt_style_replace_timed,
461                                   NULL);
462    elm_box_pack_end(bx, bt);
463    evas_object_show(bt);
464    evas_object_event_callback_add(bt, EVAS_CALLBACK_DEL, _tt_timer_del,
465                                   NULL);
466
467    bt = elm_button_add(win);
468    elm_object_text_set(bt, "Unlocked tooltip visibility");
469    elm_object_tooltip_text_set(bt, "This tooltip is unlocked visible,<br/>"
470                                    " click the button to lock!");
471    evas_object_smart_callback_add(bt, "clicked", _tt_visible_lock_toggle,
472                                   NULL);
473    elm_box_pack_end(bx, bt);
474    evas_object_show(bt);
475
476    se = elm_entry_add(win);
477    elm_entry_scrollable_set(se, EINA_TRUE);
478    evas_object_size_hint_weight_set(se, EVAS_HINT_EXPAND, 0.0);
479    evas_object_size_hint_align_set(se, EVAS_HINT_FILL, 0.5);
480    elm_entry_scrollbar_policy_set(se, ELM_SCROLLER_POLICY_OFF,
481                                            ELM_SCROLLER_POLICY_OFF);
482    elm_object_text_set(se, "Hello, some scrolled entry here!");
483    elm_object_tooltip_text_set(se, "Type something here!");
484    elm_entry_single_line_set(se, 1);
485    elm_box_pack_end(bx, se);
486    evas_object_show(se);
487
488    lst = elm_list_add(win);
489    li = elm_list_item_append(lst, "Hello", NULL, NULL, NULL, NULL);
490    elm_list_item_tooltip_content_cb_set(li, _tt_item_label, NULL, NULL);
491    elm_list_item_tooltip_window_mode_set(li, EINA_TRUE);
492    li = elm_list_item_append(lst, "Icon Tooltip", NULL, NULL, NULL, NULL);
493    elm_list_item_tooltip_content_cb_set(li, _tt_item_icon, NULL, NULL);
494    li = elm_list_item_append(lst, "Big Icon Tooltip", NULL, NULL, NULL, NULL);
495    elm_list_item_tooltip_content_cb_set(li, _tt_item_icon2, NULL, NULL);
496    elm_list_item_tooltip_style_set(li, "transparent");
497    elm_list_item_tooltip_window_mode_set(li, EINA_TRUE);
498    li = elm_list_item_append(lst, "Insanely Big Icon Tooltip", NULL, NULL, NULL, NULL);
499    elm_list_item_tooltip_content_cb_set(li, _tt_item_icon3, NULL, NULL);
500    elm_list_item_tooltip_style_set(li, "transparent");
501    elm_list_item_tooltip_window_mode_set(li, EINA_TRUE);
502    evas_object_size_hint_weight_set(lst, EVAS_HINT_EXPAND,
503                                     EVAS_HINT_EXPAND);
504    evas_object_size_hint_align_set(lst, EVAS_HINT_FILL, EVAS_HINT_FILL);
505    evas_object_size_hint_min_set(lst, 100, 100);
506    elm_list_go(lst);
507    elm_box_pack_end(bx, lst);
508    evas_object_show(lst);
509
510    evas_object_resize(win, 320, 580);
511    evas_object_show(win);
512 }
513
514 void
515 test_tooltip2(void *data       __UNUSED__,
516               Evas_Object *obj __UNUSED__,
517               void *event_info __UNUSED__)
518 {
519    Evas_Object *win, *bg, *bx, *grid, *gl;
520    Elm_Genlist_Item *it1, *it2, *it3;
521    static Testitem ti[144];
522    int i, n;
523    char buf[PATH_MAX];
524    const char *img[9] =
525    {
526       "panel_01.jpg",
527       "plant_01.jpg",
528       "rock_01.jpg",
529       "rock_02.jpg",
530       "sky_01.jpg",
531       "sky_02.jpg",
532       "sky_03.jpg",
533       "sky_04.jpg",
534       "wood_01.jpg",
535    };
536
537    win = elm_win_add(NULL, "tooltip2", ELM_WIN_BASIC);
538    elm_win_title_set(win, "Tooltip 2");
539    elm_win_autodel_set(win, EINA_TRUE);
540
541    bg = elm_bg_add(win);
542    evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND,
543                                     EVAS_HINT_EXPAND);
544    elm_win_resize_object_add(win, bg);
545    evas_object_show(bg);
546
547    bx = elm_box_add(win);
548    evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND,
549                                     EVAS_HINT_EXPAND);
550    elm_win_resize_object_add(win, bx);
551    evas_object_show(bx);
552
553    grid = elm_gengrid_add(win);
554    elm_gengrid_item_size_set(grid, 100, 100);
555    elm_gengrid_horizontal_set(grid, EINA_FALSE);
556    elm_gengrid_multi_select_set(grid, EINA_TRUE);
557    evas_object_size_hint_align_set(grid, EVAS_HINT_FILL, EVAS_HINT_FILL);
558    evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND,
559                                     EVAS_HINT_EXPAND);
560
561    gic.item_style = "default";
562    gic.func.text_get = grdt_lbl_get;
563    gic.func.content_get = grdt_content_get;
564
565    n = 0;
566    for (i = 0; i < 9; i++)
567      {
568         snprintf(buf, sizeof(buf), "%s/images/%s", elm_app_data_dir_get(),
569                  img[n]);
570         n++;
571         ti[i].mode = i;
572         ti[i].path = eina_stringshare_add(buf);
573         ti[i].item = elm_gengrid_item_append(grid, &gic, &(ti[i]), NULL,
574                                              NULL);
575         if (n % 2)
576           elm_gengrid_item_tooltip_text_set(ti[i].item, "Testing X");
577         else
578           elm_gengrid_item_tooltip_text_set(ti[i].item, "Testing Y");
579         if (!(i % 5))
580           elm_gengrid_item_selected_set(ti[i].item, EINA_TRUE);
581      }
582
583    elm_box_pack_end(bx, grid);
584    evas_object_show(grid);
585
586    gl = elm_genlist_add(win);
587    evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL);
588    evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND,
589                                     EVAS_HINT_EXPAND);
590
591    itct.item_style = "default";
592    itct.func.text_get = gltt_text_get;
593
594    it1 = elm_genlist_item_append(gl, &itct, (void *)1, NULL,
595                                  ELM_GENLIST_ITEM_SUBITEMS, NULL, NULL);
596    it2 = elm_genlist_item_append(gl, &itct, (void *)2, NULL,
597                                  ELM_GENLIST_ITEM_SUBITEMS, NULL, NULL);
598    it3 = elm_genlist_item_append(gl, &itct, (void *)3, NULL,
599                                  ELM_GENLIST_ITEM_NONE, NULL, NULL);
600
601    elm_genlist_item_tooltip_text_set(it1, "Testing 1");
602    elm_genlist_item_tooltip_text_set(it2, "Testing 2");
603    elm_genlist_item_tooltip_text_set(it3, "Testing 3");
604
605    evas_object_smart_callback_add(gl, "expand,request", gltt_exp_req, gl);
606    evas_object_smart_callback_add(gl, "contract,request", gltt_con_req,
607                                   gl);
608    evas_object_smart_callback_add(gl, "expanded", gltt_exp, gl);
609    evas_object_smart_callback_add(gl, "contracted", gltt_con, gl);
610
611    elm_box_pack_end(bx, gl);
612    evas_object_show(gl);
613
614    evas_object_resize(win, 320, 480);
615    evas_object_show(win);
616 }
617
618 #endif