diff --git a/lib/widget/dialog.c b/lib/widget/dialog.c index d9b8d0323..a6eaeaaf7 100644 --- a/lib/widget/dialog.c +++ b/lib/widget/dialog.c @@ -614,20 +614,21 @@ do_refresh (void) void dlg_draw (WDialog * h) { + Widget *w = WIDGET (h); WGroup *g = GROUP (h); - if (!widget_get_state (WIDGET (h), WST_ACTIVE)) + if (!widget_get_state (w, WST_ACTIVE)) return; if (g->winch_pending) { g->winch_pending = FALSE; - send_message (h, NULL, MSG_RESIZE, 0, NULL); + send_message (w, NULL, MSG_RESIZE, 0, NULL); } - send_message (h, NULL, MSG_DRAW, 0, NULL); - group_send_broadcast_msg (g, MSG_DRAW); - widget_update_cursor (WIDGET (h)); + send_message (w, NULL, MSG_DRAW, 0, NULL); + group_default_callback (w, NULL, MSG_DRAW, 0, NULL); + widget_update_cursor (w); } /* --------------------------------------------------------------------------------------------- */ diff --git a/lib/widget/group.c b/lib/widget/group.c index 481717e05..8ad109930 100644 --- a/lib/widget/group.c +++ b/lib/widget/group.c @@ -380,6 +380,21 @@ group_default_resize (WGroup * g, WRect * r) group_set_position (g, &r0); } +/* --------------------------------------------------------------------------------------------- */ + +static void +group_draw (WGroup * g) +{ + /* draw all widgets in Z-order, from first to last */ + if (widget_get_state (WIDGET (g), WST_ACTIVE)) + { + GList *p; + + for (p = g->widgets; p != NULL; p = g_list_next (p)) + widget_draw (WIDGET (p->data)); + } +} + /* --------------------------------------------------------------------------------------------- */ /*** public functions ****************************************************************************/ /* --------------------------------------------------------------------------------------------- */ @@ -423,6 +438,10 @@ group_default_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, g_list_foreach (g->widgets, group_widget_init, NULL); return MSG_HANDLED; + case MSG_DRAW: + group_draw (g); + return MSG_HANDLED; + case MSG_CURSOR: return group_update_cursor (g);