On 05/25/12 11:50, Greg Ercolano wrote:
> thirupathi reddy Mekala <reddy.ru...@gmail.com> writes:
>> I am also getting same problem. When i clicked on a button ones at that
>> time  no errors and opening another window. but clicked on  twice am
>> getting error floating point  Exception.
> 
>       Then please include .. a small compilable
>       program that demonstrates the problem.

    For example, this program does what you describe.
    It doesn't crash for me on linux with fltk 1.3.x svn current.

    If it does crash for you, or you can modify it to crash
    post the code, and let us know the platform and version of FLTK.

--- snip
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Button.H>
void Button_CB(Fl_Widget *w, void *data) {
    Fl_Window *win2 = (Fl_Window*)data;
    if ( win2->visible() )
        { win2->hide(); }
    else
        { win2->show(); }
}
int main() {
  // OPEN FIRST WINDOW WITH BUTTON TO TOGGLE THE SECOND
  Fl_Window *win1 = new Fl_Window(200,100,"Window 1");
  Fl_Button *but1 = new Fl_Button(10,10,160,25,"Toggle Window #2");
  win1->end();
  win1->show();
  // CREATE A SECOND WINDOW, HIDE IT
  Fl_Window *win2 = new Fl_Window(300,300,"Window #2");
  win2->end();
  win2->hide();
  // SET BUTTON CALLBACK TO TOGGLE VISIBILITY OF SECOND WINDOW
  but1->callback(Button_CB, (void*)win2);
  return Fl::run();
}
--- snip
_______________________________________________
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to