|
AlignGroup. Pretty nifty. Ok... here's how to get it working in the test/layout demo. First of all, the includes have to be corrected (see fltk2-migrate tool) and THEN... Add a bunch of "begins()". Yup. That's all that was wrong with it. re. AlignGroup.cxx [AlignGroup is not listed in the class reference docs.] ** in AlignGroup::layout, if children() (number of) is zero, this will crash with a floating point exception. Might want to do a "fatal()" warning here so the user knows where the error occurred. Here's what I've done. In AlignGroup.cxx #include <fltk/error.h> And after this line... int nx = vertical() ? n_lines : n_to_break() ? n_to_break() : children(); Add this... // rs-> if(nx == 0) fltk::fatal("AlignGroup class Error: missing begin()???"); And now that we know what the problem was, it's easy to fix. see attached (fixed) test/layout.cxx And here's what it looks like. ![]() Pretty COOL!! That could save a lot of time trying to get buttons laid out just right for a, say, a calculator or something. Folks, all these buttons start out at offset 0,0 and size 0,0. Pretty darned cool. |
layout.cxx.tar.gz
Description: GNU Zip compressed data
_______________________________________________ fltk-bugs mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk-bugs

