Looking at the intentions of your TestWin class,
here's what I think you want:
---- snip
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Button.H>
class TestWin : public Fl_Double_Window
{
Fl_Button *But;
Fl_Double_Window *NuWin;
// Callback inside class
static void Button_CB(Fl_Widget* w, void* v)
{
TestWin* tWin = (TestWin*)v; // userdata is pointer to self
tWin->NuWin->show(); // resolve NuWin through pointer to self
}
public:
// Ctor
TestWin(int w, int h, const char* c=0) : Fl_Double_Window(w,h,c) {
// Create button inside window
But = new Fl_Button(40, 50, 75, 30, "CB Test");
But->callback(Button_CB, (void*)this); // configure callback
with userdata as pointer to self
end();
// Create a separate physical window
NuWin = new Fl_Double_Window(50, 100, "Hooray!");
}
};
int main()
{
TestWin *tWin = new TestWin(150,150,"Test"); // create instance of
custom class
tWin->show(); // show the custom
class window
return(Fl::run());
}
---- snip
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk