Menu

#2509 unexpected radiobutton selection behavior

obsolete: 8.5.4
open
5
2008-09-18
2008-09-18
No

The following code operates differently between tk 8.4 and 8.5.

Under 8.4, the 3 button frame appears with the first entry having a green background, but no button selected.

Under 8.5, the first button having a green background, the first two buttons have a red dot but no black dot indicating selection, and the third button having the round button indicator, with no color inside the circle.

Note that if I then move the mouse over the first button of the application, that circle changes from being red to being a round button with a black center, but still dim.

I am unable to determine if this strange situation of having things change like this is intentional behavior by Tk or a bug.

The code is simple:
package require Tk

wm title . [info tclversion]

frame .frame
pack .frame

wm title . "Ex.1: [info tclversion]"

frame .frame.typ
pack .frame.typ

set mcolor bisque
set acolor green

radiobutton .frame.typ.rad1 -relief raised -text "" -font 7x13bold \
-width 12 -selectcolor red -anchor w -variable radio1 -value "radio1" -b
ackground $mcolor -activebackground $acolor -state active
radiobutton .frame.typ.rad2 -relief raised -text "" -font 7x13bold \
-width 12 -selectcolor red -anchor w -variable radio2 -value "radio2" -b
ackground $mcolor -activebackground $acolor -state normal
radiobutton .frame.typ.rad3 -relief raised -text "" -font 7x13bold \
-width 12 -selectcolor red -anchor w -variable radio3 -value "radio3" -b
ackground $mcolor -activebackground $acolor -state disabled

pack .frame.typ.rad1 -side top
pack .frame.typ.rad2 -side top
pack .frame.typ.rad3 -side top

Discussion

MongoDB Logo MongoDB