First, the overall situation:
My program main screen uses SDL+OpenGL. There is a FLTK window at the start that shows a project list, where you can select a project and open the main window. But you can bypass this screen and open the main window directly if you pass the project name on the command line. Once in the main window, it can eventually call some dialogs that are FLTK windows.
And here's where it gets weird:
The moment I put an Fl_Input widget on one of those dialogs that are called from the SDL window, the program crashes the moment the cursor gets inside the Fl_Input widget. gdb tells me that it crashes on the FLTK function that changes the cursor.
I'm using FLTK 1.4 master branch, but I tested it with 1.3.5 too, with the same results.
After fighting this bug for two days, I noticed that if I introduce an Fl_Input widget on the first screen *before* the SDL window opens, then it works, and the FLTK dialog that opens after the SDL window works too. And this led me to the following workaround:
static void ugly_HACK_workaround_fltk_setcursor_bug() { Fl_Window w(10, 10, 20, 20); w.show(); w.cursor (FL_CURSOR_INSERT); w.hide(); }
I just call this function at the very start of the program, and the bug is fixed.
--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/f1ecf10a-f414-41aa-b411-fa50db48920an%40googlegroups.com.
[ Direct Link to Message ] |