DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2094
Version: 1.3-current


If Fl_Input is created with when(FL_WHEN_ENTER_KEY_ALWAYS),
the callback is triggered even when there's simple focus changes.

To see the problem:

    1) Run attached program; 
    2) Type into "Input A" and hit 'Tab' to move focus to "Input B"
    3) The input callback is incorrectly triggered.
    4) Click back and forth between "Input A" and "Input B"
    5) Whenever you click on Input B, Input A's callback is
       incorrectly triggered.

It would appear that FL_LEAVE events are triggering FL_ENTER callbacks.


Link: http://www.fltk.org/str.php?L2094
Version: 1.3-current
// Demonstrate problem with when(FL_ENTER_KEY_ALWAYS)
#include <stdio.h>
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Input.H>
void Input_CB(Fl_Widget *w, void *data) {
    fprintf(stderr, "INPUT CALLBACK FOR '%s'\n", w->label());
}
int main() {
     Fl_Window win(400, 100);

     Fl_Input a(120,10,200,25,"Input A");
     a.when(FL_WHEN_ENTER_KEY_ALWAYS);
     a.callback(Input_CB);

     Fl_Input b(120,40,200,25,"Input B");
     b.when(FL_WHEN_ENTER_KEY);
     b.callback(Input_CB);

     win.show();
     return(Fl::run());
}
    
_______________________________________________
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs

Reply via email to