DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR Pending]

Link: http://www.fltk.org/str.php?L2948
Version: 1.3-feature


Attached file "test-top_window.cxx"...


Link: http://www.fltk.org/str.php?L2948
Version: 1.3-feature
#include <FL/Fl.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Button.H>

int main(int argc, char **argv) {
  Fl_Double_Window win1(900, 400, "Top-level Window");                   
win1.box(FL_FLAT_BOX); win1.color(FL_RED);
  Fl_Button        b1(10,10,140,25,"Button1:in top");
  Fl_Window        sub1(10,40,win1.w()-20,win1.h()-40-10,"Sub Window");  
sub1.box(FL_FLAT_BOX); sub1.color(FL_GREEN);
  Fl_Button        b2(10,10,140,25,"Button2:in sub1");
  Fl_Window        sub2(10,40,sub1.w()-20,sub1.h()-40-10,"Sub2 Window"); 
sub2.box(FL_FLAT_BOX); sub2.color(FL_BLUE);
  Fl_Button        b3(10,10,140,25,"Button3:in sub2");
  sub2.end();
  sub1.end();
  win1.end();
  win1.show();
  Fl_Widget *w;
  w = &win1; printf(" WIN: top_window()=%p/%-20s window()=%p/%s 
\n",w->top_window(), w->top_window()->label(),w->window(), 
                                                                    
w->window()?w->window()->label():"?");
  w = &b1;   printf("  B1: top_window()=%p/%-20s window()=%p/%s 
\n",w->top_window(), w->top_window()->label(),w->window(),
                                                                    
w->window()?w->window()->label():"?");
  w = &sub1; printf("SUB1: top_window()=%p/%-20s window()=%p/%s 
\n",w->top_window(), w->top_window()->label(),w->window(),
                                                                    
w->window()?w->window()->label():"?");
  w = &b2;   printf("  B2: top_window()=%p/%-20s window()=%p/%s 
\n",w->top_window(), w->top_window()->label(),w->window(),
                                                                    
w->window()?w->window()->label():"?");
  w = &sub2; printf("SUB2: top_window()=%p/%-20s window()=%p/%s 
\n",w->top_window(), w->top_window()->label(),w->window(),
                                                                    
w->window()?w->window()->label():"?");
  w = &b3;   printf("  B3: top_window()=%p/%-20s window()=%p/%s 
\n",w->top_window(), w->top_window()->label(),w->window(),
                                                                    
w->window()?w->window()->label():"?");
  return(Fl::run());
}

//
// End of "$Id: table-simple.cxx 9086 2011-09-29 21:10:59Z greg.ercolano $".
//
_______________________________________________
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to