Custom skinning: how to manage parameters

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

  • Custom skinning: how to manage parameters

    I'd like to create a custom skin for buttons. It will be simple: a centered text with a border. I don't want the pressing effect, i.e. the slight movement of the text when the button is pressed.

    I can use BUTTON_SetTextColor, BUTTON_SetBkgColor and so on to set some graphical parameter of the button. But I need to set the border width during run-time, because it could change for each shown button. How can I achieve this? There isn't a suitable function such as BUTTON_SetBorder.

    The only solution I found is to create the button with BUTTON_CreateUser and use the user data to save custom graphical parameters for the single button instance.

    If I understood correctly, the flex skin parameters/properties are identical for all buttons. In other words, I can't have two skinflex buttons with different graphical properties (one green and the other red, for example). Is it correct?

    The post was edited 1 time, last by giusloq ().

  • Hi,

    There are several ways to manage the appearance of a button. If skinning is used you can use your own skin(s) for the buttons. Using different skins simultaneously for multiple buttons is possible. Further it is possible to overwrite the callback function as shown in the sample WIDGET_ButtonRound.c. Extra data required for drawing a button could be attached as user data.

    Regards, Jörg
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.