Check-in [0cf378bdd2]

Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Escape some characters so that <<WidgetViewSync>> displays properly in the html
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 0cf378bdd2c9f23c200ae45a7899d2a9802855ca07b0e211b5b39d16d1d936c1
User & Date: fvogel 2019-01-02 13:03:56
Context
2019-01-08
08:37
fix typo check-in: da14be79f4 user: pooryorick tags: trunk
2019-01-02
13:03
Escape some characters so that <<WidgetViewSync>> displays properly in the html check-in: 0cf378bdd2 user: fvogel tags: trunk
2019-01-01
17:07
fix for markdown dialect check-in: 6fc9ac29eb user: dkf tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tip/438.md.

62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
..
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
...
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
It is proposed to add two new commands to the text widget:

 > _pathName_ **sync** _?-command command?_

 > _pathName_ **pendingsync**

Also a new virtual event **<<WidgetViewSync>>** will be added.

Description:

_pathName_ **sync**

    Immediately brings the line metrics up-to-date by forcing computation of
    any outdated line pixel heights. Indeed, to maintain a responsive
................................................................................
    calculations, the scheduling is immediate. The command returns the empty
    string. **bgerror** is called on _command_ failure.

_pathName_ **pendingsync**

    Returns 1 if the line calculations are not up-to-date, 0 otherwise.

**<<WidgetViewSync>>**

    A widget can have a period of time during which the internal data model is
    not in sync with the view. The **sync** method forces the view to be in
    sync with the data. The **<<WidgetViewSync>>** virtual event fires when
    the internal data model starts to be out of sync with the widget view, and
    also when it becomes again in sync with the widget view. For the text
    widget, it fires when line metrics become outdated, and when they are
    up-to-date again. Note that this means it fires in particular when
    _pathName_ **sync** returns \(if there was pending updates\). The detail
    field \(%d substitution\) is either true \(when the widget is in sync\) or
    false \(when it is not\).

All **sync**, **pendingsync** and **<<WidgetViewSync>>** apply to
each text widget independently of its peers.

The names **sync**, **pendingsync** and **<<WidgetViewSync>>** are chosen
because of the potential for generalization to other widgets they have.

The text widget documentation will be augmented by a short section describing
the asynchronous update of line metrics, the reasons for that background
update, the drawbacks regarding possibly wrong results in **.text yview** or
**.text yview moveto**, and the way to solve these issues by using the new
commands. Example code as below will be provided in the documentation, since
................................................................................
   number of pixels used by the text widget contents is needed, because this
   total pixel height calculation involves the total number of display \(not
   logical\) lines. Assessing the total number of display lines has a
   performance cost similar to proper line heights calculation, which voids
   that path.

 * It has been proposed that the detail field %d for the
   **<<WidgetViewSync>>** event contain the number of outdated lines, while
   this event would fire at each [after 1] partial update of the line metrics.
   This was rejected since no use case of this value could be exhibited, and it
   was believed that firing the event twice \(when out of sync and when again in
   sync\) was sufficient.

 * It has been proposed that the **text pendingsync** command return the
   number of currently outdated lines. This was rejected because no use case






|







 







|












|


|







 







|







62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
..
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
...
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
It is proposed to add two new commands to the text widget:

 > _pathName_ **sync** _?-command command?_

 > _pathName_ **pendingsync**

Also a new virtual event **\<\<WidgetViewSync\>\>** will be added.

Description:

_pathName_ **sync**

    Immediately brings the line metrics up-to-date by forcing computation of
    any outdated line pixel heights. Indeed, to maintain a responsive
................................................................................
    calculations, the scheduling is immediate. The command returns the empty
    string. **bgerror** is called on _command_ failure.

_pathName_ **pendingsync**

    Returns 1 if the line calculations are not up-to-date, 0 otherwise.

**\<\<WidgetViewSync\>\>**

    A widget can have a period of time during which the internal data model is
    not in sync with the view. The **sync** method forces the view to be in
    sync with the data. The **<<WidgetViewSync>>** virtual event fires when
    the internal data model starts to be out of sync with the widget view, and
    also when it becomes again in sync with the widget view. For the text
    widget, it fires when line metrics become outdated, and when they are
    up-to-date again. Note that this means it fires in particular when
    _pathName_ **sync** returns \(if there was pending updates\). The detail
    field \(%d substitution\) is either true \(when the widget is in sync\) or
    false \(when it is not\).

All **sync**, **pendingsync** and **\<\<WidgetViewSync\>\>** apply to
each text widget independently of its peers.

The names **sync**, **pendingsync** and **\<\<WidgetViewSync\>\>** are chosen
because of the potential for generalization to other widgets they have.

The text widget documentation will be augmented by a short section describing
the asynchronous update of line metrics, the reasons for that background
update, the drawbacks regarding possibly wrong results in **.text yview** or
**.text yview moveto**, and the way to solve these issues by using the new
commands. Example code as below will be provided in the documentation, since
................................................................................
   number of pixels used by the text widget contents is needed, because this
   total pixel height calculation involves the total number of display \(not
   logical\) lines. Assessing the total number of display lines has a
   performance cost similar to proper line heights calculation, which voids
   that path.

 * It has been proposed that the detail field %d for the
   **\<\<WidgetViewSync\>\>** event contain the number of outdated lines, while
   this event would fire at each [after 1] partial update of the line metrics.
   This was rejected since no use case of this value could be exhibited, and it
   was believed that firing the event twice \(when out of sync and when again in
   sync\) was sufficient.

 * It has been proposed that the **text pendingsync** command return the
   number of currently outdated lines. This was rejected because no use case