diff --git a/include/gwin/gwin.h b/include/gwin/gwin.h index 47c2e38d..3d994d0a 100644 --- a/include/gwin/gwin.h +++ b/include/gwin/gwin.h @@ -165,6 +165,16 @@ void gwinDestroyWindow(GHandle gh); /* Drawing Functions */ +/** + * @brief Draw the window + * @note Redraws the Window if the GWIN object has a draw routine + * + * @param[in] gh The window handle + * + * @api + */ +void gwinDraw(GHandle gh); + /** * @brief Clear the window * @note Uses the current background color to clear the window diff --git a/src/gwin/gwin.c b/src/gwin/gwin.c index 58d75694..9f009fa1 100644 --- a/src/gwin/gwin.c +++ b/src/gwin/gwin.c @@ -107,6 +107,21 @@ void gwinDestroyWindow(GHandle gh) { } } +void gwinDraw(GHandle gh) { + switch(gh->type) { + #if GWIN_NEED_BUTTON + case GW_BUTTON: + gwinButtonDraw(gh); + break; + #endif + #if GWIN_NEED_SLIDER + case GW_SLIDER: + gwinSliderDraw(gh); + break; + #endif + } +} + #if GDISP_NEED_TEXT void gwinSetFont(GHandle gh, font_t font) { gh->font = font;