Hi,
I'm trying to get the height of a Fl_Pack after adding some
widgets to it.
the allignment is as expected, but the output of h() always stays
the same as initially set. (see code below);
i'd like to resize a parent Fl_tile with this output.
Am i doing something wrong here, or does anybody know a
simpler solution for adjusting a Fl_tile when adding
widgets dynamicaly ?
thanks,
Thomas
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Pack.H>
#include <stdio.h>
int main(int argc, char** argv){
Fl_Window window(200,200);
Fl_Pack* p = new Fl_Pack(0,0,200,20);
p->end();
for ( int i=1; i < 11; i++ ) {
char buf[20];
sprintf(buf,"%d",i);
Fl_Box* o = new Fl_Box(0,0,200,20);
o->copy_label(buf);
o->box(FL_ENGRAVED_BOX);
p->add(o);
printf("Added Box Nr.: %d, Pack Height = %d \n", i, p->h());
}
window.show();
return Fl::run();
}
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk