[EMAIL PROTECTED] wrote:
> Hi,
> I just can't understand why the child window doesn't appear when I execute 
> the code below:

        That was a core dumper for me.

        I moved things around a bit to make it run normally..
        not sure which of the things I changed were necessary, but
        you can diff it against yours.


--- snip

#include <FL/Fl.H>
#include <FL/Fl_Double_Window.H>
class ChildWnd : public Fl_Double_Window
{
public:
     ChildWnd(int x, int y, int w, int h, const char *l): Fl_Double_Window(x, 
y, w, h, l)
     {
         set_non_modal();
         clear_border();
         box(FL_UP_BOX);
         color((Fl_Color) FL_RED);
         end();                 // end current window
     }
};

class Application : public Fl_Double_Window
{
     ChildWnd *childWnd;
public:
     Application(int w, int h, const char *l, int argc, char *argv[]) : 
Fl_Double_Window(w, h, l)
     {
         end();                 // end current window to prevent parenting 
children
         resizable(this);
         show(argc, argv);      // do show() before creating child

         childWnd = new ChildWnd(20,20,200,50, "child window");
         childWnd->show();
     }
};

int main (int argc, char ** argv)
{
     Application myApp(500, 300, "Main Window", argc, argv);
     return(Fl::run());
}
--- snip
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to