I rebuilded the code in a new project (just in case) but the problem still
occurs.
I'm afraid there is a serious bug with XP pro. May be the bug occurs just with
the pro version of XP.... I really don't know.
Does someone as any clue or idea ?
I put once again the code that is supposed to work:
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Box.H>
class MyClass : public Fl_Window {
Fl_Button *butt;
Fl_Button *butt2;
Fl_Box *box;
void my_callback(Fl_Widget *w)
{
begin();
box = new Fl_Box(10,40, 100, 100);
box->box(FL_DOWN_BOX);
box->color((Fl_Color) FL_WHITE);
end();
redraw();
}
void my_callback2(Fl_Widget *w)
{
if(box)
{
Fl::delete_widget(box);
box = 0;
}
}
static void my_static_callback(Fl_Widget *w, void *data) {
((MyClass*)data)->my_callback(w);
}
static void my_static_callback2(Fl_Widget *w, void *data) {
((MyClass*)data)->my_callback2(w);
}
public:
MyClass(int X, int Y):Fl_Window(X,Y) {
butt = new Fl_Button(5,10,90,25,"Display");
butt2 = new Fl_Button(105,10,90,25,"Clear");
butt->callback(my_static_callback, (void*)this);
butt2->callback(my_static_callback2, (void*)this);
box = 0;
end();
}
};
int main(int argc, char **argv) {
MyClass myclass(200,200);
myclass.show(argc, argv);
return Fl::run();
}
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk