> > > measure_label() works after set, but I'd like to know before=20 > > setting, without knowing the font/size used. fl_measure=20 > > didn't work for me, weird values, plus requires knowning font=20 > > and font size, that's why having one that can just be called=20 > > with NULL/0 as font and/or size would use defaults. Also=20 > > would like to be able to set the size that will be used for=20 > > wrapping width as an option. > > > What you are asking for makes no sense, really. > There is (strictly speaking) no concept of a default font in fltk > (though many widgets default to FL_HELVETICA at 14-pixel size, it is not > strictly a default) so until you set a face/size for the measure > functions to utilise, there is nothing to measure... > > Did you read the docs for fl_meaure? It describes how setting the "w" > param before calling it is used to set the wrap width - this sounds like > exactly what you are asking for, so I don't see what the problem is...? >
For one, one of the improvents mentioned before were to be able to set the application level font/size (can be done)/etc.. otherwise using the default. But I really don't need to know any of that. I just want to know how big this text will be so I can build the controls the proper size in the proper place. If I had a special font/size I'd be using, I could pass it on, otherwise I leave it NULL or 0 and it determines the font/size used by a widget (it's before creating it). Also, I find that "measure_label" doesn't work right unless you set the ww and hh to zero before calling, it doesn't seem to initialize variables but add to them or something? That's unexpected for sure. So right now you have to create the widget with text, then measure it (besure to init ww and hh first), then resize / position / or size it to it's final location. Instead of, measuring the text, creating the widget (this is mainly for static text controls - fl_box - text being placed on the window). _______________________________________________ fltk-dev mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk-dev
