[STFL] why is pos_name only updated on draw?

Mark Eichin eichin-stfl at thok.org
Thu Nov 29 07:11:02 CET 2007


(Using Ubuntu Gutsy (python-stfl 0.15-3) and source references are
based on that.)

Working on my little xml-tree viewer, setting the name of the listitem
to the path through the tree so I can display it in a title bar.
Discovered that while pos was getting set immediately, pos_name didn't
get set until another pass through run().  A quick look at the code
showed that pos is set in wt_list_process(), but pos_name is set in
wt_list_draw(); since stfl_form_run runs f_draw first, then loops
running f_process, it can never be in sync.

I've worked around it in my python app by always following .run(0)
with a .run(-1) to get the extra draw pass, so pos_name is in sync,
but of course this *does* an extra draw (not that you can see it on a
modern machine running xterm :-) which seems wrong...


More information about the STFL mailing list