pawel wrote:
> Hi,
> I've seen a couple examples of Fl_Gl_Windows sitting nicely within a parent
> window and am wondering how to sit a regular Fl_Window within another. I've
> read the existing forum threads on this but, still can't get the following
> little thing to work. A fuller program showed that the sub was being drawn
> 'void', that is leaving a blank where it should be, the blank drawing over
> whatever else was there. I can get what I need to happen using Groups but,
> would like to have subwindows going if possible.
A subwindow doesn't show any borders or such by default.
In your following example there's nothing that can be _seen_
in your subwindow. If you want to see your subwindow, add
a color or box type, or add some widgets (see below).
> #include <FL/Fl.H>
> #include <FL/Fl_Window.H>
>
> int main (int argc, char ** argv)
> {
> Fl_Window window(300, 300, "big window");
> Fl_Window sub(10, 10, 100, 100, "sub");
sub.color(FL_WHITE); // add a background color
> window.end();
> window.show();
> sub.show();
> return(Fl::run());
> }
>
> If I move the sub 'constructor' passed window.end() then it shows but then
> isn't a subwindow, it's then just another window.
That's correct. And although the minimal change above works,
I'd suggest to add "sub.end();" after the sub.color() line,
just to be sure where to add child widgets later.
You can also look at test/subwindow.cxx for another example.
Albrecht
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk