Changeset f1f433d in mainline for uspace/lib/ui/src/pbutton.c


Ignore:
Timestamp:
2022-11-04T20:54:04Z (3 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3a6d44b7
Parents:
fc00f0d
Message:

Update window button when window caption changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ui/src/pbutton.c

    rfc00f0d rf1f433d  
    114114
    115115        ui_control_delete(pbutton->control);
     116        free(pbutton->caption);
    116117        free(pbutton);
    117118}
     
    183184{
    184185        pbutton->isdefault = isdefault;
     186}
     187
     188/** Set push button caption.
     189 *
     190 * @param pbutton Button
     191 * @param caption New caption
     192 * @return EOK on success, ENOMEM if out of memory
     193 */
     194errno_t ui_pbutton_set_caption(ui_pbutton_t *pbutton, const char *caption)
     195{
     196        char *dcaption;
     197
     198        dcaption = str_dup(caption);
     199        if (dcaption == NULL)
     200                return ENOMEM;
     201
     202        free(pbutton->caption);
     203        pbutton->caption = dcaption;
     204        return EOK;
    185205}
    186206
Note: See TracChangeset for help on using the changeset viewer.