On Fri, Feb 26, 2010 at 7:06 PM, Christopher Michael
<cpmicha...@comcast.net> wrote:
> On 02/26/2010 05:59 AM, Brian Wang wrote:
>>
>> On Fri, Feb 26, 2010 at 6:38 PM, Christopher Michael
>> <cpmicha...@comcast.net> wrote:
>
> <I clipped some of the old text out of here>
>
>>> Well, what I reviewed was the sample code :)
>>
>> OK. I thought you meant the patch, while you really meant 'bad
>> programming' of mis-usage of elm_win_resize_object_add(). :-)
>>
> LOL, na ... it's never 'bad programming' when something is misunderstood.
> It's 'bad programming' AFTER it's misunderstood (and then still used) :0
:-)
>
>>
>> OK. This makes sense on how resize_object_add should be used. Thanks
>> for clearing things up for me. :-) That'll make me write the code
>> more correctly hereon.
>
> :)
>
>> However, it doesn't seem to be the only case that's causing
>> resizing/positioning issue. It may or may not be in my code. I'm
>> sorry that I don't have another piece of solid sample code to
>> demonstrate the issue.
>>
> Well, if you get one, feel free to pass it along ;) I'll gladly help when I
> can (assuming available time and knowledge) :)
I looked at my code again and found it's due to my stupid usage of
evas_object_size_hint_weight_set() calls. If you're interested,
please take a look at the attached code and /good (vim user?).
It's now all making sense to me! After all, I'm the one to be blamed,
not elementary.
Thank you again. I'm very grateful for your patience. :-)
>
>> I still don't think it's sane to change the geometry of a
>> supposed-maximized window when elm_win_resize_object_add() is called.
>> I'm not saying we should tolerate bad programming practice of me
>> though. :-)
>
> That is very true !! I would agree there also. If the window is already
> maximized, than changing the size of the window isn't really an ideal thing
> to do. This may be something to bring up on the mailing list as another
> topic (or a new thread)...just so that people with more knowledge about elm
> can respond (read Raster) :)
That's why I'm cc'ing this back to the mailing list as it seems you
forgot to do it last time. :-)
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 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);
}
static Evas_Object *xxx_win;
void pw(void)
{
int x, y, w, h;
evas_object_geometry_get(xxx_win, &x, &y, &w, &h);
printf("Win geo: %d,%d,%d,%d\n", x, y, w, h);
}
EAPI int elm_main(int argc, char **argv)
{
Evas_Object *win, *bg, *bx, *bt;
xxx_win = win = elm_win_add(NULL, "hello", ELM_WIN_BASIC);
//elm_win_conformant_set(win, 1);
printf("win=%p\n", win);
elm_win_title_set(win, "Hello");
elm_win_autodel_set(win, 1);
evas_object_resize(win, 320, 240);
bg = elm_bg_add(win);
#if 1
// good
evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND,
EVAS_HINT_EXPAND);
#else
// bad
evas_object_size_hint_weight_set(bg, 0.0, 0.0);
#endif
elm_win_resize_object_add(win, bg);
evas_object_show(bg);
bx = elm_box_add(win);
evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND,
EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(bx);
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® 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