On 03/20/12 13:53, Jerome M. Berger wrote:
> Speaking of 3.0, is it already usable? With *relative* widget
> coordinates? (the latter is the main reason I use 2.0 instead of 1.x).

        Unless you want to help with 3.0 dev or testing,
        I would suggest against using it until it has released.

        As an application developer, I prefer to consider unreleased
        libs as software that simply doesn't exist.
        
        I'd suggest instead work with 1.3.x if possible.

        If all you need is relative coords in groups, you can do that
        in 1.3.x using Fl_Window in place of Fl_Group. For example,
        the following shows 4 groupings of buttons. The buttons are
        all positioned at the same relative coordinates (10,10):

#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Button.H>
//
// Demonstrate relative coordinates using Fl_Window as groups -erco 3/20/12
//
int main(int argc, const char *argv[]) {
    Fl_Window *win = new Fl_Window(430,430,"Relative Coords Test");

      Fl_Window *grp1 = new Fl_Window(10,10,200,200,"Group 1");
        grp1->box(FL_BORDER_BOX);
        grp1->color(46);
        new Fl_Button(10,10,140,25,"Button #1");        // relative to grp1
        new Fl_Button(10,45,140,25,"Button #2");
      grp1->end();

      Fl_Window *grp2 = new Fl_Window(220,10,200,200,"Group 2");
        grp2->box(FL_BORDER_BOX);
        grp2->color(46);
        new Fl_Button(10,10,140,25,"Button #3");        // relative to grp2
        new Fl_Button(10,45,140,25,"Button #4");
      grp2->end();

      Fl_Window *grp3 = new Fl_Window(10,220,200,200,"Group 3");
        grp3->box(FL_BORDER_BOX);
        grp3->color(46);
        new Fl_Button(10,10,140,25,"Button #5");        // relative to grp3
        new Fl_Button(10,45,140,25,"Button #6");
      grp3->end();

      Fl_Window *grp4 = new Fl_Window(220,220,200,200,"Group 4");
        grp4->box(FL_BORDER_BOX);
        grp4->color(46);
        new Fl_Button(10,10,140,25,"Button #7");        // relative to grp4
        new Fl_Button(10,45,140,25,"Button #8");
      grp4->end();

    win->end();
    win->show();
    return(Fl::run());
}
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to