summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2011-10-25 08:45:56 +0000
committerCarsten Haitzler <raster@rasterman.com>2011-10-25 08:45:56 +0000
commite352969bb6a7fa24b6bb1e0c345c0415dd00827c (patch)
tree9112e2cb713d780a13c8b91f188740fc4e0de86a /legacy
parentfe364aa6015849e87778c823b23dd2d683e1ebf6 (diff)
add util call to save always adding win, setting title, adding bg,
showing it etc. etc. -> standard kind of window. SVN revision: 64376
Diffstat (limited to 'legacy')
-rw-r--r--legacy/elementary/src/lib/Elementary.h.in14
-rw-r--r--legacy/elementary/src/lib/elm_win.c20
2 files changed, 34 insertions, 0 deletions
diff --git a/legacy/elementary/src/lib/Elementary.h.in b/legacy/elementary/src/lib/Elementary.h.in
index e6c1614a8c..cc7ae66af1 100644
--- a/legacy/elementary/src/lib/Elementary.h.in
+++ b/legacy/elementary/src/lib/Elementary.h.in
@@ -3800,6 +3800,20 @@ extern "C" {
3800 */ 3800 */
3801 EAPI Evas_Object *elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type); 3801 EAPI Evas_Object *elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type);
3802 /** 3802 /**
3803 * Adds a window object with standard setup
3804 *
3805 * @param name The name of the window
3806 * @param title The title for the window
3807 *
3808 * This creates a window like elm_win_add() but also puts in a standard
3809 * background with elm_bg_add(), as well as setting the window title to
3810 * @p title. The window type created is of type ELM_WIN_BASIC, with NULL
3811 * as the parent widget.
3812 *
3813 * @return The created object, or NULL on failure
3814 */
3815 EAPI Evas_Object *elm_win_util_standard_add(const char *name, const char *title);
3816 /**
3803 * Add @p subobj as a resize object of window @p obj. 3817 * Add @p subobj as a resize object of window @p obj.
3804 * 3818 *
3805 * 3819 *
diff --git a/legacy/elementary/src/lib/elm_win.c b/legacy/elementary/src/lib/elm_win.c
index d79bdc2f01..00c5470c18 100644
--- a/legacy/elementary/src/lib/elm_win.c
+++ b/legacy/elementary/src/lib/elm_win.c
@@ -1613,6 +1613,26 @@ elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type)
1613 return win->win_obj; 1613 return win->win_obj;
1614} 1614}
1615 1615
1616EAPI Evas_Object *
1617elm_win_util_standard_add(const char *name, const char *title)
1618{
1619 Evas_Object *win, *bg;
1620
1621 win = elm_win_add(NULL, name, ELM_WIN_BASIC);
1622 if (!win) return;
1623 elm_win_title_set(win, title);
1624 bg = elm_bg_add(win);
1625 if (!bg)
1626 {
1627 evas_object_del(win);
1628 return NULL;
1629 }
1630 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1631 elm_win_resize_object_add(win, bg);
1632 evas_object_show(bg);
1633 return win;
1634}
1635
1616EAPI void 1636EAPI void
1617elm_win_resize_object_add(Evas_Object *obj, Evas_Object *subobj) 1637elm_win_resize_object_add(Evas_Object *obj, Evas_Object *subobj)
1618{ 1638{