Tk Source Code

View Ticket
Login
Ticket UUID: 1100518
Title: Button should stay in -overrelief state after event
Type: Bug Version: 8.4.9, 8.6.18, 9.0.5, 9.1b1
Submitter: nobody Created on: 2005-01-11 23:11:20
Subsystem: 03. [*button] and [label] Assigned To: aku
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2026-09-29 17:09:31
Resolution: Fixed Closed By: nemethi
    Closed on: 2026-09-29 17:09:31
Description:
Given the following Tcl/Tk 8.4.9 example:

console hide
wm state . zoomed
raise .
frame .tb -bd 1 -relief raised 
button .tb.bt1 -text "Button1" -relief flat -overrelief
raised
pack .tb -fill x -side top 
pack .tb.bt1 -side left

When the mouse hovers over Button1 it's -overrelief
option is raised.  However, after the button is pressed
the relief is returning back to the -relief option,
even though the mouse is still hovering over the button.

Button1 should still be in it's -overrelief state
always as long as the mouse is over it, even if the
button was pressed.

Thanks!
USCode
User Comments: nemethi (claiming to be Csaba Nemethi) added on 2026-09-29 17:09:31:

Serhiy, many thanks for fixing this very long-standing bug! The fix is now merged into main, core-9-0-branch, and core-8-6-branch by commits [3aa08341], [50f72925], and [ee0599a5]. Closing the ticket.


serhiy.storchaka added on 2026-09-28 20:05:56:

Still reproducible with 9.1 on X11 and Windows. tk::ButtonUp restores the saved -relief after a click even if the mouse is still in the button, so -overrelief is lost until the mouse leaves and enters the button again. Checkbuttons and radiobuttons are not affected.

Proposed fix in branch button-overrelief-after-click, with test button-16.1.


jenglish added on 2005-01-18 00:09:56:
Logged In: YES 
user_id=68433

Same thing happens on X11.

nobody added on 2005-01-12 06:13:46:
Logged In: NO 

Sorry, forgot to mention this is on WindowsXP.

nobody added on 2005-01-12 06:13:03:
Logged In: NO 

Sorry, forgot to mention this is on WindowsXP.