diff --git a/components/rtgui/widgets/box.c b/components/rtgui/widgets/box.c index 579e3dfffe28974644732cdc68fef264cd55f9b9..e5fc0e831869e311c08464e52fb514c364bc4cd2 100644 --- a/components/rtgui/widgets/box.c +++ b/components/rtgui/widgets/box.c @@ -75,6 +75,12 @@ void rtgui_box_append(struct rtgui_box* box, rtgui_widget_t* widget) rtgui_container_add_child(RTGUI_CONTAINER(box), widget); } +void rtgui_box_delete(struct rtgui_box* box, rtgui_widget_t* widget) +{ + /* remove from box's children list */ + rtgui_container_remove_child(RTGUI_CONTAINER(box), widget); +} + static void rtgui_box_layout_vertical(rtgui_box_t* box) { rtgui_list_t *node; diff --git a/components/rtgui/widgets/combobox.c b/components/rtgui/widgets/combobox.c index c1191620033484782e2110e4973d71108bbfa765..972d467fed9ca989c973c63d1b2a7faf999a5516 100644 --- a/components/rtgui/widgets/combobox.c +++ b/components/rtgui/widgets/combobox.c @@ -207,13 +207,11 @@ rt_bool_t rtgui_combobox_event_handler(struct rtgui_widget* widget, struct rtgui case RTGUI_EVENT_FOCUSED: { /* item focused */ - struct rtgui_item* item; struct rtgui_event_focused* focused; focused = (struct rtgui_event_focused*) event; - item = (struct rtgui_item*) (focused->widget); - if (item != RT_NULL) + if (focused->widget != RT_NULL) { /* hide pull down window */ rtgui_win_hiden(RTGUI_WIN(box->pd_win)); diff --git a/components/rtgui/widgets/workbench.c b/components/rtgui/widgets/workbench.c index 1e57df70a9dd2eb7949b5dcee61d7790e274772f..4dd3f7e6e8d3e976afc9e932c7bc97f51751877e 100644 --- a/components/rtgui/widgets/workbench.c +++ b/components/rtgui/widgets/workbench.c @@ -147,6 +147,7 @@ void rtgui_workbench_close(rtgui_workbench_t* workbench) /* detach from panel */ edetach.panel = workbench->panel; + edetach.workbench = workbench; /* send PANEL DETACH to server */ if (rtgui_thread_send_sync(RTGUI_TOPLEVEL(workbench)->server,