I am trying to change the cursor inside a FLTK window: the following code
#include "FL/Fl.H"
#include "FL/Fl_Double_Window.H"
Fl_Cursor CUR_DEF = FL_CURSOR_HAND;
int main(){
Fl_Double_Window* W = new Fl_Double_Window(200,200,"test");
W -> cursor(CUR_DEF);
W -> show();
return Fl::run();
}
does not work, and it does not work even using default_cursor(CUR_DEF). But as soon as I move W -> cursor(CUR_DEF); after W -> show(), the hand cursor appears if I firstly move the cursor on the window's title bar (in this case, "test") or if I firstly move the window across the screen. Why the right cursor is not appearing when the program is launched?
Moreover, when the cursor leaves the window and enter again, the cursor returns to be the system one, and becomes the "hand" only if it passes over the title bar.
I am using FLTK 1.3.5, clang version 14.0.0, on a MacBook pro.