Ignore:
Timestamp:
Jan 12, 2004, 6:30:09 PM (16 years ago)
Author:
Sam Hocevar
Message:
  • src/graphics.c: + Implemented caca_set_title() for X11 and Win32.
  • examples/cacaview.c: + Use caca_set_title() to set the window title to "cacaview".
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/src/graphics.c

    r336 r343  
    938938#endif /* _DOXYGEN_SKIP_ME */
    939939
     940/** \brief Set the window title.
     941 *
     942 *  If libcaca runs in a window, try to change its title. This works with
     943 *  the X11 and Win32 drivers.
     944 *
     945 *  \param title The desired window title.
     946 *  \return 0 upon success, a non-zero value if an error occurs.
     947 */
     948int caca_set_title(char const *title)
     949{
     950#if defined(USE_X11)
     951    if(_caca_driver == CACA_DRIVER_X11)
     952    {
     953        XStoreName(x11_dpy, x11_window, title);
     954    }
     955    else
     956#endif
     957#if defined(USE_WIN32)
     958    if(_caca_driver == CACA_DRIVER_WIN32)
     959    {
     960        SetConsoleTitle(title);
     961    }
     962    else
     963#endif
     964    {
     965        /* Not supported */
     966        return -1;
     967    }
     968
     969    return 0;
     970}
     971
    940972/** \brief Set the refresh delay.
    941973 *
Note: See TracChangeset for help on using the changeset viewer.