From: raster Date: Tue, 25 Oct 2011 08:45:56 +0000 (+0000) Subject: add util call to save always adding win, setting title, adding bg, X-Git-Tag: REL_F_I9500_20120323_1~17^2~1500 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5a6e2499e21f714ed57839caefddf13f7a3c78e0;p=framework%2Fuifw%2Felementary.git add util call to save always adding win, setting title, adding bg, showing it etc. etc. -> standard kind of window. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@64376 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/Elementary.h.in b/src/lib/Elementary.h.in index e6c1614..cc7ae66 100644 --- a/src/lib/Elementary.h.in +++ b/src/lib/Elementary.h.in @@ -3800,6 +3800,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. * * diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c index d79bdc2..00c5470 100644 --- a/src/lib/elm_win.c +++ b/src/lib/elm_win.c @@ -1613,6 +1613,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) {