Re: [elementary] How to get evas object out of elementary.Window
On Mon, 24 Aug 2009 13:25:34 +0200 Laszlo KREKACS laszlo.krekacs.l...@gmail.com said: correct. the c code works. to be honest - i work on the c. with the c. apps too. i never look at the python so i have no idea what it is doing. but you did the 100% right thing. check the c code and see what it's doing api/behavior-wise. this is how it should be. to be totally honest... it's just as easy to use elm from as from python, so poking around the c api is possible and easy. On Mon, Aug 24, 2009 at 10:52 AM, Laszlo KREKACSlaszlo.krekacs.l...@gmail.com wrote: Unfortunately my C knowledge are almost nonexistant, so maybe it will take some weeks to get there, writing a simple demonstration application in C. As others pointed out, the preferred way of doing C development is installing elementary on the desktop machine and develop on it (and crosscompile for the neo). So I installed elementary, and ran the test application from here: http://trac.enlightenment.org/e/wiki/Elementary Now, I modified the source, to get the evas canvas (evass), and print some info about it, and add other evas object to it, so not some elementary widget, but pure evas object. In C, everything works as expected, evas_object_evas_get does return with a valid evas canvas object. And I can directly add other objects to it. In python this does not work. For convenience, I post[1] my demonstration code (many thanks to devilhorns from #e). What you are supposed to see, is a blue line(evas.Line) added over the Hello world! elementary label widget. The next exercise would be to fix the python bindings. But I see these pyx, pxi, pxd files the first time in my life http://trac.enlightenment.org/e/browser/trunk/BINDINGS/python/python-elementary/include/elementary Best regards, Laszlo [1]: #include Elementary.h #include Evas.h static void win_del(void *data, Evas_Object *obj, void *event_info) { elm_exit(); } EAPI int elm_main(int argc, char **argv) { Evas_Object *win, *bg, *lb, *lin; Evas *evass; int w = 0, h = 0; char buf[4096]; win = elm_win_add(NULL, hello, ELM_WIN_BASIC); elm_win_title_set(win, Hello); evas_object_smart_callback_add(win, delete-request, win_del, NULL); evass = evas_object_evas_get(win); evas_output_size_get(evass, w, h); printf(Width: %d\tHeight: %d\n, w, h); //snprintf(buf, sizeof(buf), lol: %d, evas_output_size_get (evass-changed); 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); 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); lin = evas_object_line_add(evass); evas_object_line_xy_set(lin,10, 10 , 20, 30); evas_object_layer_set(lin, 55); // evas_object_clip_set(ob, panel_clip); evas_object_color_set(lin, 0, 0, 255, 200); evas_object_show(lin); evas_object_show(lb); evas_object_show(win); evas_output_size_get(evass, w, h); printf(Width2: %d\tHeight2: %d\n, w, h); elm_run(); evas_output_size_get(evass, w, h); printf(Width3: %d\tHeight3: %d\n, w, h); elm_shutdown(); return 0; } ELM_MAIN() ___ Openmoko community mailing list community@lists.openmoko.org http://lists.openmoko.org/mailman/listinfo/community -- - Codito, ergo sum - I code, therefore I am -- The Rasterman (Carsten Haitzler)ras...@rasterman.com ___ Openmoko community mailing list community@lists.openmoko.org http://lists.openmoko.org/mailman/listinfo/community
Re: [elementary] How to get evas object out of elementary.Window
On Mon, Aug 24, 2009 at 1:00 AM, Laszlo KREKACSlaszlo.krekacs.l...@gmail.com wrote: And please paste the result here. My results via ssh session: python Python 2.6.2 (r262:71600, Sep 7 2009, 00:26:26) [GCC 4.1.2] on linux2 Type help, copyright, credits or license for more information. import elementary elementary.init() win = elementary.Window(, elementary.ELM_WIN_BASIC) win_evas = win.evas_get() type(win_evas) type 'NoneType' type(win.evas) type 'NoneType' cheers Denis ___ Openmoko community mailing list community@lists.openmoko.org http://lists.openmoko.org/mailman/listinfo/community
Re: [elementary] How to get evas object out of elementary.Window
On Wed, Sep 9, 2009 at 5:02 AM, Denis Johnsondenis.john...@gmail.com wrote: win = elementary.Window(, elementary.ELM_WIN_BASIC) win_evas = win.evas_get() type(win_evas) type 'NoneType' type(win.evas) type 'NoneType' FYI it is fixed in enlightenment svn. Morphis fixed for me. Thanks for him! It just needs repackaging in SHR. Best regards, Khiraly ___ Openmoko community mailing list community@lists.openmoko.org http://lists.openmoko.org/mailman/listinfo/community
Re: [elementary] How to get evas object out of elementary.Window
On Mon, Aug 24, 2009 at 4:07 AM, c_ccchan...@yahoo.com wrote: Here's the output - maybe my bindings are off too. Thank you! Would be nice to know if in pure C, it behaves the same way, ie. it returns with None (or null or 0 or whatever C do), if we request evas_get() on a elementary.Window object. Unfortunately my C knowledge are almost nonexistant, so maybe it will take some weeks to get there, writing a simple demonstration application in C. Best regards, Laszlo ___ Openmoko community mailing list community@lists.openmoko.org http://lists.openmoko.org/mailman/listinfo/community
Re: [elementary] How to get evas object out of elementary.Window
On Mon, Aug 24, 2009 at 10:52 AM, Laszlo KREKACSlaszlo.krekacs.l...@gmail.com wrote: Unfortunately my C knowledge are almost nonexistant, so maybe it will take some weeks to get there, writing a simple demonstration application in C. As others pointed out, the preferred way of doing C development is installing elementary on the desktop machine and develop on it (and crosscompile for the neo). So I installed elementary, and ran the test application from here: http://trac.enlightenment.org/e/wiki/Elementary Now, I modified the source, to get the evas canvas (evass), and print some info about it, and add other evas object to it, so not some elementary widget, but pure evas object. In C, everything works as expected, evas_object_evas_get does return with a valid evas canvas object. And I can directly add other objects to it. In python this does not work. For convenience, I post[1] my demonstration code (many thanks to devilhorns from #e). What you are supposed to see, is a blue line(evas.Line) added over the Hello world! elementary label widget. The next exercise would be to fix the python bindings. But I see these pyx, pxi, pxd files the first time in my life http://trac.enlightenment.org/e/browser/trunk/BINDINGS/python/python-elementary/include/elementary Best regards, Laszlo [1]: #include Elementary.h #include Evas.h static void win_del(void *data, Evas_Object *obj, void *event_info) { elm_exit(); } EAPI int elm_main(int argc, char **argv) { Evas_Object *win, *bg, *lb, *lin; Evas *evass; int w = 0, h = 0; char buf[4096]; win = elm_win_add(NULL, hello, ELM_WIN_BASIC); elm_win_title_set(win, Hello); evas_object_smart_callback_add(win, delete-request, win_del, NULL); evass = evas_object_evas_get(win); evas_output_size_get(evass, w, h); printf(Width: %d\tHeight: %d\n, w, h); //snprintf(buf, sizeof(buf), lol: %d, evas_output_size_get(evass-changed); 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); 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); lin = evas_object_line_add(evass); evas_object_line_xy_set(lin,10, 10 , 20, 30); evas_object_layer_set(lin, 55); // evas_object_clip_set(ob, panel_clip); evas_object_color_set(lin, 0, 0, 255, 200); evas_object_show(lin); evas_object_show(lb); evas_object_show(win); evas_output_size_get(evass, w, h); printf(Width2: %d\tHeight2: %d\n, w, h); elm_run(); evas_output_size_get(evass, w, h); printf(Width3: %d\tHeight3: %d\n, w, h); elm_shutdown(); return 0; } ELM_MAIN() ___ Openmoko community mailing list community@lists.openmoko.org http://lists.openmoko.org/mailman/listinfo/community
Re: [elementary] How to get evas object out of elementary.Window
On 8/24/09, Laszlo KREKACS laszlo.krekacs.l...@gmail.com wrote: On Mon, Aug 24, 2009 at 10:52 AM, Laszlo KREKACSlaszlo.krekacs.l...@gmail.com wrote: Unfortunately my C knowledge are almost nonexistant, so maybe it will take some weeks to get there, writing a simple demonstration application in C. As others pointed out, the preferred way of doing C development is installing elementary on the desktop machine and develop on it (and crosscompile for the neo). So I installed elementary, and ran the test application from here: http://trac.enlightenment.org/e/wiki/Elementary Now, I modified the source, to get the evas canvas (evass), and print some info about it, and add other evas object to it, so not some elementary widget, but pure evas object. In C, everything works as expected, evas_object_evas_get does return with a valid evas canvas object. And I can directly add other objects to it. In python this does not work. For convenience, I post[1] my demonstration code (many thanks to devilhorns from #e). What you are supposed to see, is a blue line(evas.Line) added over the Hello world! elementary label widget. The next exercise would be to fix the python bindings. But I see these pyx, pxi, pxd files the first time in my life http://trac.enlightenment.org/e/browser/trunk/BINDINGS/python/python-elementary/include/elementary Best regards, Laszlo [1]: #include Elementary.h #include Evas.h static void win_del(void *data, Evas_Object *obj, void *event_info) { elm_exit(); } EAPI int elm_main(int argc, char **argv) { Evas_Object *win, *bg, *lb, *lin; Evas *evass; int w = 0, h = 0; char buf[4096]; win = elm_win_add(NULL, hello, ELM_WIN_BASIC); elm_win_title_set(win, Hello); evas_object_smart_callback_add(win, delete-request, win_del, NULL); evass = evas_object_evas_get(win); evas_output_size_get(evass, w, h); printf(Width: %d\tHeight: %d\n, w, h); //snprintf(buf, sizeof(buf), lol: %d, evas_output_size_get(evass-changed); 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); 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); lin = evas_object_line_add(evass); evas_object_line_xy_set(lin,10, 10 , 20, 30); evas_object_layer_set(lin, 55); // evas_object_clip_set(ob, panel_clip); evas_object_color_set(lin, 0, 0, 255, 200); evas_object_show(lin); evas_object_show(lb); evas_object_show(win); evas_output_size_get(evass, w, h); printf(Width2: %d\tHeight2: %d\n, w, h); elm_run(); evas_output_size_get(evass, w, h); printf(Width3: %d\tHeight3: %d\n, w, h); elm_shutdown(); return 0; } ELM_MAIN() ___ Openmoko community mailing list community@lists.openmoko.org http://lists.openmoko.org/mailman/listinfo/community Bug morphis about that, he should be able to fix it ;) I also have issue to morphis about python-elementary (I need working anchors in AnchorBlock), so when I'll get him I'll also tell him about that evas_get issue. -- Sebastian Krzyszkowiak dos ___ Openmoko community mailing list community@lists.openmoko.org http://lists.openmoko.org/mailman/listinfo/community
Re: [elementary] How to get evas object out of elementary.Window
Hi, Here's the output - maybe my bindings are off too. Python 2.6.2 (r262:71600, Jun 18 2009, 19:00:10) [GCC 4.1.2] on linux2 Type help, copyright, credits or license for more information. import elementary elementary.init() win = elementary.Window(, elementary.ELM_WIN_BASIC) win_evas = win.evas_get() type(win_evas) type 'NoneType' type(win.evas) type 'NoneType' HTH -- View this message in context: http://n2.nabble.com/elementary-How-to-get-evas-object-out-of-elementary-Window-tp3498820p3501036.html Sent from the Openmoko Community mailing list archive at Nabble.com. ___ Openmoko community mailing list community@lists.openmoko.org http://lists.openmoko.org/mailman/listinfo/community