diff --git a/components/rtgui/include/rtgui/widgets/list_view.h b/components/rtgui/include/rtgui/widgets/list_view.h index 2d3b2bf6d2..1a55043ac8 100644 --- a/components/rtgui/include/rtgui/widgets/list_view.h +++ b/components/rtgui/include/rtgui/widgets/list_view.h @@ -21,7 +21,7 @@ #include -typedef void (*item_action)(void* parameter); +typedef void (*item_action)(struct rtgui_widget* widget, void* parameter); struct rtgui_list_item { char* name; diff --git a/components/rtgui/widgets/list_view.c b/components/rtgui/widgets/list_view.c index 2a9f697c27..f29671d155 100644 --- a/components/rtgui/widgets/list_view.c +++ b/components/rtgui/widgets/list_view.c @@ -373,7 +373,8 @@ static rt_bool_t rtgui_list_view_onmouse(struct rtgui_list_view* view, struct rt /* up event */ if (view->items[view->current_item].action != RT_NULL) { - view->items[view->current_item].action(view->items[view->current_item].parameter); + view->items[view->current_item].action(RTGUI_WIDGET(view), + view->items[view->current_item].parameter); } } } @@ -407,7 +408,8 @@ static rt_bool_t rtgui_list_view_onmouse(struct rtgui_list_view* view, struct rt /* up event */ if (view->items[view->current_item].action != RT_NULL) { - view->items[view->current_item].action(view->items[view->current_item].parameter); + view->items[view->current_item].action(RTGUI_WIDGET(view), + view->items[view->current_item].parameter); } } } @@ -537,7 +539,8 @@ rt_bool_t rtgui_list_view_event_handler(struct rtgui_widget* widget, struct rtgu case RTGUIK_RETURN: if (view->items[view->current_item].action != RT_NULL) { - view->items[view->current_item].action(view->items[view->current_item].parameter); + view->items[view->current_item].action(RTGUI_WIDGET(view), + view->items[view->current_item].parameter); } return RT_FALSE;