Check-in [e531f63c61]

Login

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

Overview
Comment:Editorial tidy up for TIP 518
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: e531f63c611a18eaa8ae1b6971b5b59bdb90cfa3e0aaa8f27287a60f1ee788ea
User & Date: dkf 2018-10-27 14:42:14.928
Context
2018-10-27
17:08
Tidy up 523 check-in: de82360011 user: pspjuth tags: trunk
14:42
Editorial tidy up for TIP 518 check-in: e531f63c61 user: dkf tags: trunk
11:04
Updated the tip479 spec to place the new commands for dictargs wrapping in a dedicated namespace and leave room in the spec for handling alternate argument handing schemes check-in: 16ec396728 user: hypnotoad tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to tip/518.md.
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
A **frame** keeping a size without reason just feels like a bug and mostly leads to unwanted results.

Mostly, it looks just ugly, but there are critical use-cases, specially in scrolled frames.

When the BWidget autoscroll package is used, which displays scrollbars on demand, the scrollbars do not disappear if the contents is gone.
And there is nothing, a programmer can do, as the Configure event does not fire on the scrolled frame widget.

Another example is the scrolledwindow example by Emiliano in ticket 2863003fff <https://core.tcl.tk/tk/info/12006979562649c9> , where the solution 2 specific part may be removed \(or is ignored\).

A typical workaround is to configure the width/height manually after the last children was unmapped.
Unfortunately, this fact may not be determined for example by scrolling widgets etc. An eventual Configure binding is not firing.

Within this TIP, a new virtual event `<<NoManagedChild>>` is fired to inform about no remaining childs.

# Example







|







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
A **frame** keeping a size without reason just feels like a bug and mostly leads to unwanted results.

Mostly, it looks just ugly, but there are critical use-cases, specially in scrolled frames.

When the BWidget autoscroll package is used, which displays scrollbars on demand, the scrollbars do not disappear if the contents is gone.
And there is nothing, a programmer can do, as the Configure event does not fire on the scrolled frame widget.

Another example is the scrolledwindow example by Emiliano in [ticket 2863003fff](https://core.tcl.tk/tk/info/12006979562649c9), where the solution 2 specific part may be removed \(or is ignored\).

A typical workaround is to configure the width/height manually after the last children was unmapped.
Unfortunately, this fact may not be determined for example by scrolling widgets etc. An eventual Configure binding is not firing.

Within this TIP, a new virtual event `<<NoManagedChild>>` is fired to inform about no remaining childs.

# Example
51
52
53
54
55
56
57
58


59
60
61
62
63
64
65
	requested frame height: 100

Technically, the frame ".c.f.i1" was packed into the client frame ".c.f".
The client frame ".c.f" changes its requested size to hold the new child, which invokes the Convigure event and adjustes the scrolling region of the canvas.
The new scrolling region is shown graphically by the scrollbar.

Then press the "-" button to remove the user widget. The console output is:
	-


So, the child widget ".c.f.i1" is destroyed, but the frame ".c.f" does not rechange its requested size to 1x1 \(initial value\) but stays at 100x100 showing an empty plane.
The scrollbar is not updated and the megawidget has no possibility to adjust that \(expect additional user action to inform that the last child was removed\).

One may also try to add two childs and to remove them. It gets clear, that the widget is resized on removel if it is not the last widget.

With the proposed patch applied, an additional event is fired the removal of the last widget would restore the initial frame size of 1x1 which would invoke the Configure event and the scrollbar would be adjusted.








|
>
>







51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
	requested frame height: 100

Technically, the frame ".c.f.i1" was packed into the client frame ".c.f".
The client frame ".c.f" changes its requested size to hold the new child, which invokes the Convigure event and adjustes the scrolling region of the canvas.
The new scrolling region is shown graphically by the scrollbar.

Then press the "-" button to remove the user widget. The console output is:

	-

So, the child widget ".c.f.i1" is destroyed, but the frame ".c.f" does not rechange its requested size to 1x1 \(initial value\) but stays at 100x100 showing an empty plane.
The scrollbar is not updated and the megawidget has no possibility to adjust that \(expect additional user action to inform that the last child was removed\).

One may also try to add two childs and to remove them. It gets clear, that the widget is resized on removel if it is not the last widget.

With the proposed patch applied, an additional event is fired the removal of the last widget would restore the initial frame size of 1x1 which would invoke the Configure event and the scrollbar would be adjusted.

106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
	    .c.f configure -height 1
	    .c.f configure -height 0
        }
	bind .c.f <<NoManagedChild>> frameNoChild

# Reference Implementation

Emiliano has provided a ticket 2863003fff <https://core.tcl.tk/tk/info/2863003fff>  with the implementation in branch bug-d6b95ce492 <https://core.tcl.tk/tk/timeline?r=bug-d6b95ce492&nd&c=2016-09-21+06%3A32%3A55&n=200>.

This solution is now continued with the tag "tip518-event-last-child-unmanaged".

Koen Dankart and Francois Vogel have worked on the solution of the similar tip474, which is available in branch bug-d6b95ce492-alt: <http://core.tcl.tk/tk/timeline?r=bug-d6b95ce492-alt&nd&c=2016-09-22+09%3A16%3A21&n=200> .
This information may eventually also be relevant.

# Rejected Proposal

TIP 454 <https://core.tcl.tk/tips/doc/trunk/tip/454.md> has proposed to set the size of the widget automatically to 1x1 (the initial size if no widget packed/gridded).

Please read the discussion within the TIP which led to withdraw the proposal.

# Discussion

## Why not use the event name \<\<Configure\>\> ?

This is a logical and elegant proposal.

TIP 454 was withdrawn due to:

   1. if the geometry manager is changed (ex: pack to grid), there is a flickering introduced.
   2. an additional Configure event was introduced which breaks present script.

To invoke `<<Configure>>` instead `<<NoManagedChild>>` would trigger incompatibility 2 of TIP454.
Due to that, a new virtual event is proposed.

# Copyright

This document has been placed in the public domain.








|



|




|




















<
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144

	    .c.f configure -height 1
	    .c.f configure -height 0
        }
	bind .c.f <<NoManagedChild>> frameNoChild

# Reference Implementation

Emiliano has provided a [ticket 2863003fff](https://core.tcl.tk/tk/info/2863003fff) with the implementation in [branch bug-d6b95ce492](https://core.tcl.tk/tk/timeline?r=bug-d6b95ce492&nd&c=2016-09-21+06%3A32%3A55&n=200).

This solution is now continued with the tag "tip518-event-last-child-unmanaged".

Koen Dankart and Francois Vogel have worked on the solution of the similar tip474, which is available in [branch bug-d6b95ce492-alt](http://core.tcl.tk/tk/timeline?r=bug-d6b95ce492-alt&nd&c=2016-09-22+09%3A16%3A21&n=200).
This information may eventually also be relevant.

# Rejected Proposal

[TIP 454](454.md) has proposed to set the size of the widget automatically to 1x1 (the initial size if no widget packed/gridded).

Please read the discussion within the TIP which led to withdraw the proposal.

# Discussion

## Why not use the event name \<\<Configure\>\> ?

This is a logical and elegant proposal.

TIP 454 was withdrawn due to:

   1. if the geometry manager is changed (ex: pack to grid), there is a flickering introduced.
   2. an additional Configure event was introduced which breaks present script.

To invoke `<<Configure>>` instead `<<NoManagedChild>>` would trigger incompatibility 2 of TIP454.
Due to that, a new virtual event is proposed.

# Copyright

This document has been placed in the public domain.