diff --git a/src/gwin/gwin_label.c b/src/gwin/gwin_label.c index c8a9a0f0..f979bdd8 100644 --- a/src/gwin/gwin_label.c +++ b/src/gwin/gwin_label.c @@ -112,6 +112,15 @@ GHandle gwinGLabelCreate(GDisplay *g, GLabelObject *widget, GWidgetInit *pInit, return (GHandle)widget; } +void gwinLabelSetJustification(GHandle gh, justify_t justify) +{ + // is it a valid handle? + if (gh->vmt != (gwinVMT *)&labelVMT) + return; + + gh2obj->justify = justify; +} + void gwinLabelSetBorder(GHandle gh, bool_t border) { // is it a valid handle? if (gh->vmt != (gwinVMT *)&labelVMT) diff --git a/src/gwin/gwin_label.h b/src/gwin/gwin_label.h index 8c7c9fd5..0b289c92 100644 --- a/src/gwin/gwin_label.h +++ b/src/gwin/gwin_label.h @@ -66,6 +66,16 @@ extern "C" { GHandle gwinGLabelCreate(GDisplay *g, GLabelObject *widget, GWidgetInit *pInit, justify_t justify); #define gwinLabelCreate(w, pInit, justify) gwinGLabelCreate(GDISP, w, pInit, justify) +/** + * @brief Set text justification + * + * @param[in] gh The widget handle (must be a label handle) + * @param[in] justify The justification + * + * @api + */ +void gwinLabelSetJustification(GHandle gh, justify_t justify); + /** * @brief Border settings for the default rendering routine *