Tk Source Code

View Ticket
Login
Ticket UUID: 61bfd35c57a90372b3025d7f2915674c89ffee45
Title: Scrollbars keep flickering indefinitely after being destroyed
Type: Bug Version: 8.6.3
Submitter: linusnyberg Created on: 2014-12-21 20:41:49
Subsystem: 66. Aqua Window Operations Assigned To: kevin_walzer
Priority: 5 Medium Severity: Severe
Status: Closed Last Modified: 2015-01-31 20:53:05
Resolution: Fixed Closed By: kevin_walzer
    Closed on: 2015-01-31 20:53:05
Description:
The problem is Mac-only. It has been introduced some time AFTER Tcl/Tk 8.6.1. The below replication steps do not cause flickering there.
Replicated with latest source (8.6.3) as of 2014-12-21:

Do:
- Run the below script in Wish.
- Move the mouse around in the window.
- Also try resizing the window.

Happens:
Each time the mouse motion even triggers, the since-long destroyed scrollbar keeps appearing (flickering) on the screen.

Expected:
That the scrollbar is simply gone, since it was destroyed.

Here's the script:
###########################
proc main {} {
	console show
	wm geometry . 800x600
	frame .f -width 750 -height 550 -bg grey75
	place .f -x 50 -y 50 -anchor nw
	button .f.b -text hello
	place .f.b -x 100 -y 100 -anchor nw
	set w [create_window .f 10 10 300 300]
	update
	destroy $w

	bind all <Motion> {
		.f.b configure -text [clock seconds]
	}
}

proc create_window {parent_w x y width height} {
	set w $parent_w.c_container
	frame $w -bg grey75 -bd 0 -width $width -height $width
	scrollbar $w.vscroll -command "$w.c yview"
	canvas $w.c -highlightthickness 0 -width [expr {$width - 15}] -height [expr {$width}] -relief sunken -bg grey85 -bd 0 -yscrollcommand "$w.vscroll set"
	grid $w.c -padx 1 -pady 1 -row 0 -column 0 -rowspan 1 -columnspan 1 -sticky news
	grid $w.vscroll -padx 1 -pady 1 -row 0 -column 1 -rowspan 1 -columnspan 1 -sticky news

	place $w -x $x -y $y -anchor nw
	return $w
}

after 10 main
User Comments: kevin_walzer added on 2015-01-31 20:53:05:
Recent commits of HITheme updates to trunk and 8-5-branch have fixed this.

kevin_walzer added on 2014-12-24 04:51:34:
I've committed an update that seems to fix the reported issue by custom drawing the NSScroller. The custom drawing replicates the standard scrollbar pretty well, but that is less important than removing the flickering. The custom drawing is available only on 10.7 or greater, when the new scrollbar style was introduced. I am leaving 10.6 and below untested. 

Please confirm that the new commit fixes the issue and I'll close this bug.