Hello all,

I tried again and here's a simple program that reproduces the problem.
 Please see the attached code.

In the program, there are two buttons.
* Good: click the 'notify' button.  The elm_notify object appears at
the bottom as intended.
* Bad: click the 'inwin' button, click the 'close' button in the
inwin, and then click 'notify' button.  The elm_notify object is now
positioned incorrectly.

The problematic call is a elm_win_resize_object_add() call.  / for
FIXME, or Line #20.
With or without the call, elm_win_inwin is always visually correct.
Is it my fault when calling the problematic
elm_win_resize_object_add() call?  I always thought the call is not
harmful in anyway.

Thanks in advance.


brian

-- 
brian
------------------

Cool-Karaoke - The smallest recording studio, in your palm, open-sourced
http://cool-idea.com.tw/

iMaGiNaTiOn iS mOrE iMpOrTaNt tHaN kNoWlEdGe
#include <Elementary.h>

static void inwin_close(void *data, Evas_Object *obj, void *event_info)
{
        Evas_Object *inwin = data;

        evas_object_del(inwin);
}

static void inwin_show(void *data, Evas_Object *obj, void *event_info)
{
        Evas_Object *win = data;
        Evas_Object *inwin, *bx, *lb, *bt;

        inwin = elm_win_inwin_add(win);
        elm_win_resize_object_add(win, inwin);
        evas_object_show(inwin);

        bx = elm_box_add(win);
        elm_win_resize_object_add(win, bx); // FIXME: this is the line that 
cause the problem
        evas_object_show(bx);

        lb = elm_label_add(win);
        elm_label_label_set(lb, "inwin stuff");
        evas_object_size_hint_weight_set(lb, 1.0, 1.0);
        elm_win_resize_object_add(win, lb);
        elm_box_pack_end(bx, lb);
        evas_object_show(lb);

        bt = elm_button_add(win);
        elm_button_label_set(bt, "close");
        elm_box_pack_end(bx, bt);
        evas_object_smart_callback_add(bt, "clicked", inwin_close, inwin);
        evas_object_show(bt);

        elm_win_inwin_content_set(inwin, bx);
}

static void notify_show(void *data, Evas_Object *obj, void *event_info)
{
        Evas_Object *win = data;
        Evas_Object *notify, *lb;

        notify = elm_notify_add(win);
        evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, 
EVAS_HINT_EXPAND);
        elm_notify_orient_set(notify, ELM_NOTIFY_ORIENT_BOTTOM);
        evas_object_show(notify);

        lb = elm_label_add(win);
        elm_label_label_set(lb, "Hello World!");
        evas_object_size_hint_weight_set(lb, 1.0, 1.0);
        elm_win_resize_object_add(win, lb);
        evas_object_show(lb);

        elm_notify_content_set(notify, lb);
}

EAPI int elm_main(int argc, char **argv)
{
        Evas_Object *win, *bg, *lb, *notify, *bx, *bt;

        win = elm_win_add(NULL, "hello", ELM_WIN_BASIC);
        elm_win_title_set(win, "Hello");
        elm_win_autodel_set(win, 1);

        evas_object_resize(win, 320, 240);

        bg = elm_bg_add(win);
        evas_object_size_hint_weight_set(bg, 1.0, 1.0);
        elm_win_resize_object_add(win, bg);
        evas_object_show(bg);

        bx = elm_box_add(win);
        evas_object_show(bx);

        bt = elm_button_add(win);
        elm_button_label_set(bt, "inwin");
        evas_object_smart_callback_add(bt, "clicked", inwin_show, win);
        elm_box_pack_end(bx, bt);
        evas_object_show(bt);

        bt = elm_button_add(win);
        elm_button_label_set(bt, "notify");
        evas_object_smart_callback_add(bt, "clicked", notify_show, win);
        elm_box_pack_end(bx, bt);
        evas_object_show(bt);

        evas_object_show(win);

        elm_run();
        elm_shutdown();
        return 0;
}
ELM_MAIN()
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to