When the separators exist in toolbar and the toolbar shrinks by resizing window,
[framework/uifw/elementary.git] / src / examples / hoversel_example_01.c
index cf70461..412bf43 100644 (file)
@@ -1,10 +1,7 @@
 //Compile with:
-//gcc -g `pkg-config --cflags --libs elementary` hoversel_example_01.c -o hoversel_example_01
+//gcc -o hoversel_example_01 hoversel_example_01.c -g `pkg-config --cflags --libs elementary`
 
 #include <Elementary.h>
-#ifdef HAVE_CONFIG_H
-# include "elementary_config.h"
-#endif
 
 static void _print_items(void *data, Evas_Object *obj, void *event_info);
 static void _rm_items(void *data, Evas_Object *obj, void *event_info);
@@ -22,8 +19,11 @@ elm_main(int argc, char **argv)
    elm_win_title_set(win, "Hoversel");
    elm_win_autodel_set(win, EINA_TRUE);
    elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
+   evas_object_resize(win, 200, 300);
+   evas_object_show(win);
 
    bg = elm_bg_add(win);
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    elm_win_resize_object_add(win, bg);
    evas_object_show(bg);
 
@@ -49,10 +49,9 @@ elm_main(int argc, char **argv)
    evas_object_move(hoversel, 10, 10);
    evas_object_show(hoversel);
 
-   evas_object_resize(win, 200, 300);
-   evas_object_show(win);
 
    elm_run();
+   elm_shutdown();
 
    return 0;
 }
@@ -72,14 +71,14 @@ _print_items(void *data, Evas_Object *obj, void *event_info)
 static void
 _rm_items(void *data, Evas_Object *obj, void *event_info)
 {
-   if(!elm_hoversel_expanded_get(obj))
+   if (!elm_hoversel_expanded_get(obj))
      elm_hoversel_clear(obj);
 }
 
 static void
 _sel(void *data, Evas_Object *obj, void *event_info)
 {
-   if(!elm_hoversel_expanded_get(obj) && event_info != data)
+   if (!elm_hoversel_expanded_get(obj) && event_info != data)
      elm_object_item_del(event_info);
 }