Am 09.07.2016 um 19:48 schrieb Karl Harbinger:
> I'm using Unity, and I want to set the (pixmap) icon which will then be
> visible in the task bar. I can achieve this by using the code
> /win->icon(&win_icon);/ , but I can't do that with fl_message() for example.
It can be done, but only with a dirty trick. The problem is, that you
don't know the Fl_Window of the dialog and that the dialog is modal.
If you set a timeout handler *before* calling the convenience dialog
method, you can find out the Fl_Window pointer of the dialog in the
timer callback with Fl::first_window() and set it's icon.
void cb_to()
{
if ( Fl::first_window() )
{
Fl_Window *win = Fl::first_window(); // the window of the dialog
// now set the icon as usual
...
}
}
// main
...
// set timeout before opening dialog
Fl::add_timeout( 0.3, cb_to );
// the dialog
fl_message( ... )
Hacky, I know, but at least on Ubuntu 14.04 this works.