Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset b48e680f in mainline for uspace/lib/ui/src/wdecor.c


Ignore:
Timestamp:
2021-11-03T10:23:28Z (3 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
ec8a1bf
Parents:
ce862ac
git-author:
Jiri Svoboda <jiri@…> (2021-11-02 19:19:50)
git-committer:
Jiri Svoboda <jiri@…> (2021-11-03 10:23:28)
Message:

Allow console application to set the terminal window caption

File:
1 edited

Legend:

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

    rce862ac rb48e680f  
    157157{
    158158        wdecor->active = active;
     159}
     160
     161/** Change caption.
     162 *
     163 * @param wdecor Window decoration
     164 * @param caption New caption
     165 *
     166 * @return EOK on success or an error code
     167 */
     168errno_t ui_wdecor_set_caption(ui_wdecor_t *wdecor, const char *caption)
     169{
     170        char *cdup;
     171
     172        cdup = str_dup(caption);
     173        if (cdup == NULL)
     174                return ENOMEM;
     175
     176        free(wdecor->caption);
     177        wdecor->caption = cdup;
     178
     179        ui_wdecor_paint(wdecor);
     180        return EOK;
    159181}
    160182
Note: See TracChangeset for help on using the changeset viewer.