Brian, thanks for the sources and the various indications for reading.
Specifically:
On 23/08/2019 17:03, briang wrote:
<snip>
>
> One aspect to look into is the Model-View-Controller design pattern, and understand the how and why of this pattern. Important in this is the separation of the user interface from the business logic of the application. (one possible starting point: https://en.wikipedia.org/wiki/Model–view–controller)
>
OK. I know the term, but have never understood the relation to Tk well.
This is a new incentive for me to do another attempt to grasp that
design pattern and find out how that relates to Tk/GUI.
<snip>
>>
>> 1. a (course?) description of the fundamentals of the event loop, its
>> work flow.
>
> See the man page on Tcl_InitNotifier(). (
https://www.tcl.tk/man/tcl8.6/TclLib/Notifier.htm)
> I wouldn't expect any user to know to look at this man page to understand the event loop, but the detailed description you are seeking is there.
OK. Will do.
>
>> 2. a description of how changes to a GUI are divided into distinct tasks
>> for screen updates.
I probably didn't formulate the question above clearly enough, and you
may have understood only partially what I meant.
>
> Every widget does different things, and consequently will do tasks and updates slightly differently.
> Every widget has various degrees of configurability, so tcl scripts can change this behavior.
> The various geometry managers, by definition, propagate update changes up and down a widget hierarchy. This means"updates" are not a simple single Cause-and-Effect.
>
> What this means is that you have to read the description for each widget and geometry manager. Look at the way a set of widgets has been laid out on the screen, and then determine what the consequences are for the give set of objects and actions. Add to this what the business logic of the application does in triggering and responding to the GUI.
The books that you mention below, I already have read both of them (but
"Practical Programming in Tcl and Tk" only in its third edition by
Brewnt Welch alone). It's my experience that on the subject of geometry
managers, they focus on the algorithms for lay-out of widgets in a GUI.
However, they do not describe how a change to a widget/GUI is decomposed
into distinct redrawing tasks for processing by the event loop (which
are collected until idle time, and possibly
recombined/selected/reordered/rescheduled/... and finally executed in
physical screen access actions as you indicated in a previous post with
an analogy of a stone and ripples ... ).
It seems to me that it's especially this information that a programmmer
needs in order to understand exactly which (partial) screen updates are
executed at what stage/pass in the event loop. I believe it is
especially this part which makes me fail to understand why [update
idletasks] in my script in the original post results in a partial screen
update and why [update] results a complete redraw.
Do you know of any sources that specifically address this?
(sorry if my original question didn't convey this)
TIA,
Erik
>
>> 3. how these distinct tasks are processed or scheduled for processing by
>> the event loop
>
> See the references above.
> Also, it's been a long time since I read this book, but if I remember correctly, it describes how to implement some things in Tk with explanation of how things work: "Practical Programming in Tcl and Tk" by Brent Welch and Ken Jones.
>
>>
>> I expect it to require considerable effort to choose the right level of
>> detail and wording. Maybe pictures are needed besides words. Who knows,
>> maybe one day the knowledgeable writer with enough time comes forward.
>
> Also worth reading, at least once, is the chapter on Tk in "Tcl and the Tk Toolkit" by John Ousterhout and Ken Jones. (It's got pictures!)
>
>>
>> Thanks again,
>> Erik Leunissen.
>> --
>>
>> [*] That's meant as a statement without any further implications. I
>> know/appreciate how much private effort goes into this language.
>