add util call to save always adding win, setting title, adding bg,
authorraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 25 Oct 2011 08:45:56 +0000 (08:45 +0000)
committerMike McCormack <mj.mccormack@samsung.com>
Wed, 9 Nov 2011 07:32:03 +0000 (16:32 +0900)
showing it etc. etc. -> standard kind of window.

git-svn-id: https://svn.enlightenment.org/svn/e/trunk/elementary@64376 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/Elementary.h.in
src/lib/elm_win.c

index c42ece7..bd48c2c 100644 (file)
@@ -3762,6 +3762,20 @@ extern "C" {
     */
    EAPI Evas_Object *elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type);
    /**
+    * Adds a window object with standard setup
+    *
+    * @param name The name of the window
+    * @param title The title for the window
+    *
+    * This creates a window like elm_win_add() but also puts in a standard
+    * background with elm_bg_add(), as well as setting the window title to
+    * @p title. The window type created is of type ELM_WIN_BASIC, with NULL
+    * as the parent widget.
+    *
+    * @return The created object, or NULL on failure
+    */
+   EAPI Evas_Object *elm_win_util_standard_add(const char *name, const char *title);
+   /**
     * Add @p subobj as a resize object of window @p obj.
     *
     *
index cb8a6cf..7f97552 100644 (file)
@@ -1586,6 +1586,26 @@ elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type)
    return win->win_obj;
 }
 
+EAPI Evas_Object *
+elm_win_util_standard_add(const char *name, const char *title)
+{
+   Evas_Object *win, *bg;
+   
+   win = elm_win_add(NULL, name, ELM_WIN_BASIC);
+   if (!win) return;
+   elm_win_title_set(win, title);
+   bg = elm_bg_add(win);
+   if (!bg)
+     {
+        evas_object_del(win);
+        return NULL;
+     }
+   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+   elm_win_resize_object_add(win, bg);
+   evas_object_show(bg);
+   return win;
+}
+
 EAPI void
 elm_win_resize_object_add(Evas_Object *obj, Evas_Object *subobj)
 {