Another wrapper function to return an ilist items value using only the index

of selected item.



SVN revision: 47856
This commit is contained in:
Christopher Michael 2010-04-09 00:08:38 +00:00
parent 15dcb3c74e
commit 6c858bb3b0
2 changed files with 26 additions and 2 deletions

View File

@ -604,6 +604,21 @@ e_widget_ilist_nth_data_get(Evas_Object *obj, int n)
return wcb->data;
}
EAPI const char *
e_widget_ilist_nth_value_get(Evas_Object *obj, int n)
{
E_Widget_Data *wd;
E_Widget_Callback *wcb;
wd = e_widget_data_get(obj);
wcb = eina_list_nth(wd->callbacks, n);
if (!wcb)
return NULL;
else
return wcb->value;
}
/**
* Return if the given item returned by e_widget_ilist_items_get()
* is a header.
@ -674,14 +689,22 @@ EAPI void *
e_widget_ilist_item_data_get(const E_Ilist_Item *it)
{
E_Widget_Callback *wcb = it->data2;
return wcb->data;
if (!wcb)
return NULL;
else
return wcb->data;
}
EAPI const char *
e_widget_ilist_item_value_get(const E_Ilist_Item *it)
{
E_Widget_Callback *wcb = it->data2;
return wcb->value;
if (!wcb)
return NULL;
else
return wcb->value;
}
/**

View File

@ -34,6 +34,7 @@ EAPI Evas_Object *e_widget_ilist_nth_icon_get(Evas_Object *obj, int n);
EAPI void e_widget_ilist_nth_end_set(Evas_Object *obj, int n, Evas_Object *end);
EAPI Evas_Object *e_widget_ilist_nth_end_get(Evas_Object *obj, int n);
EAPI void *e_widget_ilist_nth_data_get(Evas_Object *obj, int n);
EAPI const char *e_widget_ilist_nth_value_get(Evas_Object *obj, int n);
EAPI Eina_Bool e_widget_ilist_item_is_header(const E_Ilist_Item *it);
EAPI const char *e_widget_ilist_item_label_get(const E_Ilist_Item *it);