Hi Ian, hi Albrecht,

thanks for your proposals.
I made the recommended improvements but without any effect.
On debugging I found out that the measurement of the topmost Fl_Output widget 
(calling fl_measure()) sets "0" to my width variable (wi). The measurement of 
the next widgets is ok.
That's why I think - but am not sure - that the reason is to be found in fltk, 
despite of my faults.

Bye
testalucida

>
> > protected:
> >     void draw() {
> >             int wi, he;
>
> Oops! Check the docs...
>
> Three issues:
>
> 1)You must explicitly set "wi" and "he" to zero before you call
> fl_measure(), or they will be interpreted as being width/height limits
> to wrap to.
> Since they appear to be stack variables here, we don't necessarily know
> what value they will take...
>
> 2) You must explicitly set the font that fl_measure() is to use. It does
> not necessarily know what the "current" font is, even inside a draw()
> context, so you must tell it, or it may pick up whatever the last set
> font was (which may or may not be the "correct" font for your widget...)
>
> 3) I'm not sure, but I think calling resize() inside a draw() method can
> get a bit "recursive"... so I'd suggest trying to find a different way
> to do that, perhaps.
>
> >             fl_measure( this->value(), wi, he, 0 );
> >             resize( x(), y(), wi + 6, h() );
> >             Fl_Output::draw();
> >     }
> > };
>
>
>
>
>
> SELEX Galileo Ltd
> Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS=
> 14 3EL
> A company registered in England & Wales.  Company no. 02426132
> ********************************************************************
> This email and any attachments are confidential to the intended
> recipient and may also be privileged. If you are not the intended
> recipient please delete it from your system and notify the sender.
> You should not copy it or use it for any purpose nor disclose or
> distribute its contents to any other person.
> ********************************************************************
>

_______________________________________________
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to