Tom Krenzke wrote:
> Thank you very much.  That solved the problem.

I'm glad that I could help.

> Also, I apologize for posting directly to the bug forum.

No problem. My note was only FYI.

BTW: Here's a probably better way for your button callbacks. I'll show 
only the relevant parts of the code, and please note: this is untested:


You can use argument 2 directly as a pointer to your bool variable:

// callback for the "yes" button
void yes_cb(Fl_Widget* o, void* p)
{
   // store a value of true in the response variable
   bool* b = (bool*)p;
   *b=true;
   w->hide();
}

Dto. for no_cb(), and in getResponse():

// this creates the pop up window
bool getResponse()
{
   bool response = false; // *** define this first

   Fl_Window* responseWindow = new Fl_Window(100,100,100,100,"Please 
Pick One");
   Fl_Button* yesButton = new Fl_Button(10,10,80,20,"Yes");
   Fl_Button* noButton = new Fl_Button(10,40,80,20,"No");

   // use the response var. directly in the button callbacks

   yesButton->callback(yes_cb,&response);
   noButton ->callback(no_cb,&response);

   responseWindow->end();
   responseWindow->set_modal();
   responseWindow->show();

   // *** remove the next two lines:

   // *** bool response = false;
   // *** responseWindow->user_data((void*)&response);

   // ... rest as before (with today's additions) ...


This should do the trick (I hope so at least ;-) ).

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

Reply via email to