add util call to save always adding win, setting title, adding bg,

showing it etc. etc. -> standard kind of window.



SVN revision: 64376
This commit is contained in:
Carsten Haitzler 2011-10-25 08:45:56 +00:00
parent fe364aa601
commit e352969bb6
2 changed files with 34 additions and 0 deletions

View File

@ -3799,6 +3799,20 @@ extern "C" {
* @return The created object, or NULL on failure
*/
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.
*

View File

@ -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)
{