|
|
Hi,
It seems like `Fl_Check_Browser`'s callback doesn't get called
when items are selected and deselected. I tried the example
program compiled with the last FLTK commit
(#986a8b33a2b5e503dd36ddbc8283d489ebbd9290) below with both
keyboard and mouse input:
This is correct although AFAICT undocumented. The default when() condition of Fl_Check_Browser is
FL_WHEN_NEVER which obviously does not call the callback. I can't
tell why this is so, but I believe this should be documented. It's
obviously unexpected behavior.
See comment below to make the program do what you (seem to) expect.
#include <stdio.h>
#include <FL/Fl.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Check_Browser.H>
void CB(Fl_Widget*, void *) {
puts("In the callback");
}
int main(int argc, char *argv[]) {
Fl::scheme("gtk+");
Fl_Double_Window *win = new Fl_Double_Window(250, 120, "Simple
Browser");
win->begin();
{
{
Fl_Check_Browser *brow = new Fl_Check_Browser(10, 10,
win->w()-20, 80, "Check");
brow->callback(CB);
// add here:
brow->when(FL_WHEN_CHANGED);
brow->add("Aaa");
brow->add("Bbb");
brow->add("Ccc");
brow->add("Ddd");
brow->checked(1,1);
brow->checked(2,1);
}
}
win->end();
win->resizable(win);
win->show(argc, argv);
return(Fl::run());
}
--
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/53b6316b-7e53-e25a-491e-24f4e5357187%40online.de.
[ Direct Link to Message ] | |
|
| |