> 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"?
That's my layout by column of Fl_Output widgets in a Fl_Group: _ |_| <--- measurement returns w = 0 ==> BAD ______ |______| <--- measurement ok _________ |_________| <--- measurement ok workaround: adding a "dummy" Fl_Output: _ |_| <--- measurement returns w = 0 ==> dont't care ________ |________| <--- measurement ok ______ |______| <--- measurement ok _________ |_________| <--- measurement ok let me ask you a last question: Albrecht said in a previous post, resizing in the draw method is like "asking for problems". I tried to figure out another way to solve this issue but didn't find one. Do you have an idea how to handle the requirement of making the Fl_Output's width fit to its content? > > 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