Bwidget Source Code
Check-in [cb6716528c]
Not logged in
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to tclconference@googlegroups.com
or submit via the online form by Sep 9.

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

Overview
Comment:Remove the whole <Unmap> binding, as it does not do any thing any more
Timelines: family | ancestors | descendants | both | bwidget
Files: files | file ages | folders
SHA1:cb6716528c94a1ddfa7cb6a41198bdcb37e1d35f
User & Date: oehhar 2016-10-31 17:53:00
Context
2016-11-02
23:56
scrollframe.tcl: Eric advised to check for unmapped window, as the <Map> event may be executed in the unmapped state. check-in: 6d0524a1f8 user: oehhar tags: bwidget
2016-10-31
17:53
Remove the whole <Unmap> binding, as it does not do any thing any more check-in: cb6716528c user: oehhar tags: bwidget
15:12
scrollframe.tcl: width changed when unmapped and mapped. Checkge the Configure vound proc to not be active when currently unmapped. Ticket [72a5727d1b]. Thanks to Alexandru for the ticket and patch. check-in: 06d203dbdd user: oehhar tags: bwidget
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to scrollframe.tcl.

93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
...
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
    bind $frame <Configure> \
        [list ScrollableFrame::_frameConfigure $canvas]
    # add <unmap> binding: <configure> is not called when frame
    # becomes so small that it suddenly falls outside of currently visible area.
    # but now we need to add a <map> binding too
    bind $frame <Map> \
        [list ScrollableFrame::_frameConfigure $canvas]
    bind $frame <Unmap> \
        [list ScrollableFrame::_frameConfigure $canvas 1]

    bindtags $path [list $path BwScrollableFrame [winfo toplevel $path] all]

    return [Widget::create ScrollableFrame $path]
}


................................................................................
}


# ----------------------------------------------------------------------------
#  Command ScrollableFrame::_frameConfigure
# ----------------------------------------------------------------------------
proc ScrollableFrame::_max {a b} {return [expr {$a <= $b ? $b : $a}]}
proc ScrollableFrame::_frameConfigure {canvas {unmap 0}} {
    # This ensures that we don't get funny scrollability in the frame
    # when it is smaller than the canvas space
    # use [winfo] to get height & width of frame

    # [winfo] doesn't work for unmapped frame
    if {$unmap} {
		return
	}
    set height [_max [winfo height $canvas.frame] [winfo height $canvas]]
    set width  [_max [winfo width  $canvas.frame] [winfo width  $canvas]]

    $canvas:cmd configure -scrollregion [list 0 0 $width $height]
}







<
<







 







|




<
<
<
<





93
94
95
96
97
98
99


100
101
102
103
104
105
106
...
240
241
242
243
244
245
246
247
248
249
250
251




252
253
254
255
256
    bind $frame <Configure> \
        [list ScrollableFrame::_frameConfigure $canvas]
    # add <unmap> binding: <configure> is not called when frame
    # becomes so small that it suddenly falls outside of currently visible area.
    # but now we need to add a <map> binding too
    bind $frame <Map> \
        [list ScrollableFrame::_frameConfigure $canvas]



    bindtags $path [list $path BwScrollableFrame [winfo toplevel $path] all]

    return [Widget::create ScrollableFrame $path]
}


................................................................................
}


# ----------------------------------------------------------------------------
#  Command ScrollableFrame::_frameConfigure
# ----------------------------------------------------------------------------
proc ScrollableFrame::_max {a b} {return [expr {$a <= $b ? $b : $a}]}
proc ScrollableFrame::_frameConfigure {canvas} {
    # This ensures that we don't get funny scrollability in the frame
    # when it is smaller than the canvas space
    # use [winfo] to get height & width of frame





    set height [_max [winfo height $canvas.frame] [winfo height $canvas]]
    set width  [_max [winfo width  $canvas.frame] [winfo width  $canvas]]

    $canvas:cmd configure -scrollregion [list 0 0 $width $height]
}