On 02/03/12 11:21, testalucida wrote: > Hi all, > thank you for your efforts! > It works as you say, but I still can't understand why this doesn't work: > textfont( FL_HELVETICA_BOLD ); > textsize( 12 ); > (instead of fl_font(textfont(), textsize()); )
fl_font() sets the "current font" used for drawing which fl_measure() says it needs in the docs. textfont() and textsize() don't affect the current font used for drawing, they just set the widget's text font. > And why does it work when adding a dummy Fl_Output first? Not sure I understand what you mean by "adding a dummy Fl_Ouput"? Do you mean the call to Fl_Output::draw()? If so, would make sense to do that /last/, after you do your fl_measure() and resize() calculations. It doesn't make sense to call Fl_Output::draw() first if you're just going to resize the widget later, which will cause another redraw.. drawing the widget twice instead of once.. Keep in mind if you don't call Fl_Output::draw(), the widget won't draw at all because your draw() routine is replacing it. _______________________________________________ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk