Hello. I've the following question:
Let's imagine, that we have .edc file with EXTERNAL elm widjets, i.e.:
//
collections {
group {
name: "gr_list_users";
//min: 200 300;
/* Use: Elementary */
externals {
external: "elm";
}
parts {
part {
name: "userlist";
type: EXTERNAL;
source: "elm/list";
description {
state: "default" 0.0;
}
}
}
} /* coll: list users group close */
group {
name: "gr_list_chat";
//min: 200 300;
/* Use: Elementary */
externals {
external: "elm";
}
parts {
part {
name: "chatlist";
type: EXTERNAL;
source: "elm/list";
description {
state: "default" 0.0;
}
}
}
} /* coll: list char group close */
group {
name: "main";
min: 1024 768;
/* Use: Elementary */
externals {
external: "elm";
}
parts {
// Background
part {
name: "bg";
type: RECT;
description {
state: "default" 0.0;
//color: 128 128 128 255;
rel1 {
offset: 1 1;
}
rel2 {
offset: -1 -1;
}
}
}
// Panes
part {
name: "panes";
type: EXTERNAL;
source: "elm/panes";
description {
state: "default" 0.0;
rel1 {
relative: 0.0 0.1;
offset: 1 5;
to: "bg";
}
rel2 {
relative: 1.0 0.9;
offset: -1 -5;
to: "bg";
}
params {
bool: "horizontal" 1;
string: "content left" "gr_list_users";
string: "content right" "gr_list_chat";
}
}
}
}
}
group {
name: "other";
min: 1024 768;
/* Use: Elementary */
externals {
external: "elm";
}
parts {
// Background
part {
name: "bg";
type: RECT;
description {
state: "default" 0.0;
//color: 128 128 128 255;
rel1 {
offset: 1 1;
}
rel2 {
offset: -1 -1;
}
}
}
// Panes
part {
name: "panes";
type: EXTERNAL;
source: "elm/panes";
description {
state: "default" 0.0;
rel1 {
relative: 0.0 0.1;
offset: 1 5;
to: "bg";
}
rel2 {
relative: 1.0 0.9;
offset: -1 -5;
to: "bg";
}
params {
bool: "horizontal" 1;
string: "content left" "userlist";
string: "content right" "chatlist";
}
}
}
part {
name: "userlist";
type: EXTERNAL;
source: "elm/list";
description {
state: "default" 0.0;
}
}
part {
name: "chatlist";
type: EXTERNAL;
source: "elm/list";
description {
state: "default" 0.0;
}
}
}
}
}
Let's now imagine, that we also have API .c file:
#include <Elementary.h>
static void* app_signal_exit(void* data, Evas_Object* obj, void* event) {
ecore_main_loop_quit();
}
int main(int argc, char** argv) {
ecore_init();
ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT,
(Ecore_Event_Handler_Cb)app_signal_exit, NULL);
ecore_evas_init();
Ecore_Evas* ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 0, 0);
ecore_evas_title_set(ee, "Panes_Lists_Test");
ecore_evas_borderless_set(ee, 0);
ecore_evas_shaped_set(ee, 0);
ecore_evas_show(ee);
Evas* canvas = ecore_evas_get(ee);
edje_init();
Evas_Object* edje = edje_object_add(canvas);
edje_object_file_set(edje, "panes_lists_test.edj", "other");
evas_object_move(edje, 0, 0);
Evas_Coord edje_width, edje_height;
edje_object_size_min_get(edje, &edje_width, &edje_height);
evas_object_resize(edje, edje_width, edje_height);
evas_object_show(edje);
ecore_evas_resize(ee, edje_width, edje_height);
ecore_evas_show(ee);
// API
/* switch edje with group ("gr_list_users") */
edje_object_file_set(edje, "panes_lists_test.edj", "gr_list_users");
Evas_Object* userlist =
edje_object_part_external_object_get(edje, "userlist");
Evas_Object* host_icon = elm_icon_add(edje);
elm_icon_standard_set(host_icon, "home");
elm_image_resizable_set(host_icon, EINA_FALSE, EINA_FALSE);
elm_list_item_append(userlist,
"Just a Label of List",
host_icon,
NULL,
NULL,
NULL);
/* swith edje with group ("gr_list_chat") */
edje_object_file_set(edje, "panes_lists_test.edj", "other");
ecore_main_loop_begin();
return 0;
}
The problem is following:
It compiles correctly, but if we run this program, we'll see the PANES (elm
widget) and borders of both LISTs (elm widget), BUT we won't see an appended
list element! how can we fix it?
I've tried to develop simple .edc with one background and list in the same
group
and append a list element in simple .c API file, similar to the above, but it
does not work again (.
The question is: how to interact with Elementary widgets, declared in .edc? How
to fix this problem and make elm/list to append new item correctly, that is we
would see it?
Another question is: I've tried to declare BOX part in .edc and then in API .c
code, I've tried to use edje_object_part_box_append(edje, "box name", list),
where 'list' is an Evas_Object* list = elm_list_add(...). Where should I add
this list (what is the parent)? I tried to make elm_win in the same program
along with Evas* canvas (edje is rendered on canvas), but I still can not see
the list at all.
Why my list appending does not work? Seems, that I extract elm_list correctly
from .edj and try to append. Why it does not work?
Thank you!
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
enlightenment-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-users