Hello,
I've been working with fluid for a single window for quite a while now and I 
would like my program to be able to create extra windows. Here, I just want to 
use an example where I'd like to have a menuitem of Help->About to create a 
little window with some text and an OK button, but it's not working.

Q1)In the code below, I only get the new about window to appear without the 
extra Fl_Button. Could somebody please explain why?

Q2)Also, is it all right not to make the pointer to the new button global if I 
don't intend to change its properties in the future?  I assume that a "new" 
command will allocate on the object on the stack and will stay there until I do 
a delete. (In total contradiction to my reasoning on how it's supposed to work, 
I added the while (1==1) out of desperation to see if it will help to make the 
button appear. I don't think that it is correct programming)

Q3)Every time I create a new window, is it correct to say I do NOT need some 
sort of low CPU hogging while () statement to keep data structures alive?

Thanks for your valuable advice,
Frank

/*GLOBAL VARIABLES*/
Fl_Window *aboutWinCB()
int aboutWinRunning;


aboutWinCB(FL_Widget *, void * paramVoid)
{
if (aboutWinRunning==0)
{
aboutWin = new Fl_Window(300,180)
Fl_Button *aboutOK= new Fl_Button (50,50,50,50,"OK");
/*Future: create a callback for the button to close the about window*/
aboutWin->end();
aboutWin->show();
aboutWinRunning=1;
while (1==1);
std::cout <<"Exited subroutine\n"
}
}

main()
{
aboutWinRunning=0;
}

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to