I'm using FLTK 1.3.4 on Ubuntu 18.04.
My project develops a desktop app with GUI using FLTK. When the app is started, its default icon on the dock is a "stop" sign. When you hover your mouse on it, its default popup text is "FLTK". See the screenshot below:
I'm using FLTK's adjuster example to show this.
I want to use my own icon and change the text to something else. I've learned that the API void Fl_Window::icon(const Fl_RGB_Image * icon)
can set the icon, but I haven't figured out how to change the hovering text. I've tried ``Fl_Window::labeland
Fl_Window::iconlabel` but they don't work.
Does anyone know where I should look at?
I have read this document which gave me the hint of using Fl_Window::icon()
but it doesn't mention how to set the text.
I guess I may also need to look at the GTK API (My system is using GTK 3), but after skimming the APIs on this page, I didn't find anything.
I also tried the https://www.fltk.org/doc-1.3/classFl__Window.html#a9718a55f909d150394f4a67ba762aa0cFl_Window
's constructor that accepts the window title, but it doesn't change the icon's hover text, either.
After looking around, this can be set using the method Fl_Window::xclass
. Its source code is here.
The xclass
string is used here:
XChangeProperty(fl_display, xp->xid, XA_WM_CLASS, XA_STRING, 8, 0,
(unsigned char *)buffer, len * 2 + 2);
This is an X Window API call. The XA_WM_CLASS
property is the "Application class and name for resource database lookup." It is discussed in Chapter 12. Interclient Communication in the book Xlib Programming Manual for Version 11 of the X Window System, Vol. 1.