[STFL] Getting a widget's width without drawing it?

Andreas Krennmair ak at synflood.at
Wed Sep 19 22:45:32 CEST 2007


Hi Clifford,
* Clifford Wolf <clifford at clifford.at> [07-09-19 17:23]:
>On Wed, Sep 19, 2007 at 03:51:56PM +0200, Andreas Krennmair wrote:
>> >you can (as e.g. the perl example program does) render the form by calling
>> >stfl_run with a -1 timeout (do not wait for events), gather the information
>> >from the renderer, adapt the form and then do the actual stfl_run() call.
>> 
>> Thanks, but I'm aware of this. The problem is that the time between
>> stfl_run(...,-1), retrieval of the width, filling the list widget with
>> the appropriate information, and redrawing via the normal
>> stfl_run(...,0) event loop is long enough that the user notices the
>> double redraw, which, in my case, looks just plain ugly. Actually, I use
>> this method right now, but would prefer any other method that prevents a
>> double redraw.
>
>Current trunk (rev. 83) now also has stfl_run(...,-3) which does the
>rendering (and setting :w, :h, :x and :y) but does not fetch events nor
>update the screen. This new stfl_run() mode can be used for your case.
>Older STFL releases handle mode -3 as if it where mode -1.

Wow, cool, thank you very much! That works exactly as I need it, great.

BTW, before you push out another release, could you before have a look
at the proof-of-concept patch regarding "rich text" support for the
textview that I sent to the list in August, and tell me whether the rich
text support looks OK to you from the syntactical point of view? If yes,
then I'd like to improve the patch to make it work properly with escaped
characters and multi-column Unicode characters.

Thanks,
Andreas


More information about the STFL mailing list