BKColor of a TEXT widget

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • BKColor of a TEXT widget

    Hello,

    is there a way to get the text alignment of a TEXT widget?

    For the Buttons there is a function BUTTON_GetTextAlign but sadly this is missing for the TEXT widget.

    I'm using the precompiled version (STemWin).

    Thanks for any help.

    Steven
  • Found the answer

    Disregard - found a solution.

    C Source Code

    1. TEXT_OBJ * pObj = (TEXT_OBJ*) WM_H2P(hItem); GUI_SetColor(pObj->Props.TextColor);


    WM_H2P gives me access to the address of the TEXT_PROPS and also the TEXT_STRUCT info for the alignment.

    Don't know if we're supposed to do it that way but it seems to work...

    regards

    Steven
  • Hello Steven,

    Unfortunately, the TEXT widget has no Functions to get the properties / alignment of the text.
    We will implement this functions in the next emWin release.

    For now we would recommend you to save this information in the application.
    You could save the information in a variable or set the information in the user data of the TEXT widget.

    Best regards,
    Thorsten