Bwidget Source Code
Check-in [cb6716528c]
Not logged in

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
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | bwidget
Files: files | file ages | folders
SHA1: cb6716528c94a1ddfa7cb6a41198bdcb37e1d35f
User & Date: oehhar 2016-10-31 17:53:00.611
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
Unified Diff Ignore Whitespace Patch
Changes to scrollframe.tcl.
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
    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]
}









<
<







93
94
95
96
97
98
99


100
101
102
103
104
105
106
    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]
}


242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
}


# ----------------------------------------------------------------------------
#  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]
}







|




<
<
<
<





240
241
242
243
244
245
246
247
248
249
250
251




252
253
254
255
256
}


# ----------------------------------------------------------------------------
#  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]
}