Hi,

I am testing fltk layout using Fl_Pack, but I have an issue I did not succeed 
to solve.

If I resize manually my window, everything is fine, but if I use the 
window->size method (launching the exe with an arg), my buttons resize too... 
which is different from the manual resizing.

Can somebody help me with this ?
Thanks.

Here my code :
#include <FL/Fl.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Pack.H>

Fl_Window* SecondTry(int x, int y) {
    Fl_Double_Window* w = new Fl_Double_Window(300, 400, "Pack Test");

    Fl_Pack* main = new Fl_Pack( 5, 5, 290, 390 );
    main->type(Fl_Pack::VERTICAL);
    main->spacing(10);

        Fl_Box* box = new Fl_Box(0,0,0,350, "A Tree Widget" );
        box->box(FL_DOWN_BOX);
        box->color( fl_lighter( FL_GRAY ) );

        Fl_Pack* p = new Fl_Pack(0,0,0,30);
        p->type(Fl_Pack::HORIZONTAL);
        p->spacing(10);
            new Fl_Button(0,0,100, 1, "Go Up" );
            new Fl_Button(0,0,100, 1, "Go Down" );
        p->end();

    main->resizable(box);
    w->resizable(main);
    return w;
}

int main( int argc, char** argv ) {
  Fl_Window* second = SecondTry( 350,50);
  if ( argc > 1 ) second->size(800,600);
  second->show();

  return Fl::run();
}

_______________________________________________
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to