Prev: Looking for ideas for reproducing a Tk 8.4 interface under Tk 8.5
Next: [Windows Specific]: how to resize a toplevel?
From: drscrypt on 19 Feb 2010 09:50 Larry W. Virden wrote: > A developer recently asked me to help him solve an issue. Here's a > program that no longer displays as intended when moved from Tk 8.4 to > Tk 8.5 I am using 8.4.17 and I see no change in any colors whether the buttons are selected or not. The ticks are always red, and option box labels are in green background and the checkbutton label background is pinkish. If, however, you prolong your mouse click, you see all the colors reverting to that gray Tk default temporarily while you hold the mouse button down. DrS
From: Arndt Roger Schneider on 19 Feb 2010 10:10 Larry W. Virden schrieb: >A developer recently asked me to help him solve an issue. Here's a >program that no longer displays as intended when moved from Tk 8.4 to >Tk 8.5 > >#! /usr/tcl84/bin/tclsh8.4 >package require Tk > >set type serial >set type2 N > >font create lab -family helvetica -size 12 -weight bold >font create lab10 -family helvetica -size 10 -weight bold > >proc nullcmd {} { > puts "8.4 default radiobutton $::type" > return 0 >} > >proc nullcmd2 {} { > puts "8.4 default checkbutton $::type2" > return 0 >} > >set left1 [frame .f1 -bg lightyellow -relief flat] > >set area0 [frame $left1.s -bg lightyellow -relief flat] > >label $area0.title -text "Radiobutton..." -font lab10 -bg springgreen2 >\ > -anchor w -justify left >radiobutton $area0.b1 -text "Serial" -variable type -value "serial" \ > -takefocus 0 -font lab10 -bg palegreen1 \ > -anchor w -justify left \ > -selectcolor red -command nullcmd >radiobutton $area0.b3 -text "Non-Serial" -variable type -value >"nonser" \ > -takefocus 0 -font lab10 -bg palegreen1 \ > -anchor w -justify left \ > -selectcolor red -command nullcmd >pack $area0.title $area0.b1 $area0.b3 -fill x -side top >pack $area0 -side top -pady 5 > >set checkb [checkbutton $area0.cb -text "Checkbutton..." -variable >type2 \ > -onvalue "Y" -offvalue "N" \ > -takefocus 0 -bd 3 -relief groove -font lab \ > -command nullcmd2 \ > -bg MistyRose -selectcolor red -activebackground white] >pack $checkb -padx 5 -side left > >pack $left1 -side left > > >The goal for this developer is to end up with a Tk 8.5 application >that is identical to the Tk 8.4 one. >When the above code runs against Tk 8.4, the behavior is as expected >and coded. When the above code runs against Tk 8.5, the -selectcolor >appears in each radio or check button created, whether it is selected >or not. > >The radiobutton manpage states, for selectcolor: > > Specifies a background color to use when the button is > selected. If indicatorOn is true then the color applies to > the indicator. Under Windows, this color is used as the > background for the indicator regardless of the select state. > If indicatorOn is false, this color is used as the back- > ground for the entire widget, in place of background or > activeBackground, whenever the widget is selected. If > specified as an empty string then no special color is used > for displaying when the widget is selected. > > > The entry inside the manual page is outdated. The visual change for the radio and check button indicators followed the attempt to "revitalize" Tk under X11 --prior to tile--. This vitualized designs are the same as being used by Windows 95. I guess the rational for this particular choice was: Microsoft sells so much copies of Windows it must be due to the visual quality of its GUI. As an ironic sidenote: Micosoft has almost corrected their indicators and highlighting in Vista, which is now similar to the original motif-look, albeit highlighting is still inside the control. >It is not clear to me whether the "Under Windows" means "when the Tk >application runs on Windows" or if it means "when the Tk application >DISPLAYS on Windows". > >In our case, the applications are running on a Solaris machine, >displaying back to a Windows machine via Cygwin/X . > >I'm just wondering whether the difference we are seeing reflects a >change in Tk which has not yet made it to the man page, a bug in Tk >8.5 and 8.6, or a problem when Tk 8.5 displays back to a Windows-based >X server. > > > Both: the property selectcolor should reflect a state change. The property name should have changed in 8.5 to something like indicatorBackground. -roger -- http://gestaltitems.sourceforge.net/geitems/Gstripes_Controls.html#d0e2628
From: Donald G Porter on 19 Feb 2010 10:21 Larry W. Virden wrote: > A developer recently asked me to help him solve an issue. Here's a > program that no longer displays as intended when moved from Tk 8.4 to > Tk 8.5 <snip without reading> Did you try [tk::classic::restore] ? DGP
From: Arndt Roger Schneider on 19 Feb 2010 13:22 Larry W. Virden schrieb: >On Feb 19, 10:10 am, Arndt Roger Schneider <arndt.ro...(a)web.de> wrote: > > > >>>The radiobutton manpage states, for selectcolor: >>> >>> >>> Specifies a background color to use when the button is >>> selected. If indicatorOn is true then the color applies to >>> the indicator. Under Windows, this color is used as the >>> background for the indicator regardless of the select state. >>> If indicatorOn is false, this color is used as the back- >>> ground for the entire widget, in place of background or >>> activeBackground, whenever the widget is selected. If >>> specified as an empty string then no special color is used >>> for displaying when the widget is selected. >>> >>> >>The entry inside the manual page is outdated. >> >> > > >When I read problem ticket >https://sourceforge.net/tracker/index.php?func=detail&aid=1083838&group_id=12997&atid=112997 >, which seems to say that it is a closed fixed ticket, I get the >impression that a maintainer also thought the man page was out of date >and should be fixed. However, it doesn't seem to me as if the current >reading reflects the current strange behavior. > > The mentioned bug report should have been set to "rejected" not closed and a new bug opened concerning the documentation. The bug maintainer did notice the discrepancy and suggested as much as to reopen it as a documentation bug. quotation from the bug erport: ....maybe only the *documentation* needs to be changed, to say that "selectcolor" now means the background color of the indicator, ... I say the property name has to be indicatorBackground, not selectcolor. Abusing selectcolor for the indicator background was a long tolerated hack under windows (ms), changing the complet behaviour requires to remove this hack. -roger
From: Arndt Roger Schneider on 19 Feb 2010 13:35
Larry W. Virden schrieb: >On Feb 19, 9:50 am, drscr...(a)gmail.com wrote: > > >>I am using 8.4.17 and I see no change in any colors whether the buttons >>are selected or not. The ticks are always red, and option box labels >>are in green background and the checkbutton label background is pinkish. >> >> > >We are using Tk 8.4.9 (built from the formal release of the source). >Upon the start of the program, we see the radio buttons with a light >green background, the serial button a red diamond indicating it is >selected and the non-serial button the black outline of an unselected >diamond. The bisque check button has a raised relief square >unselected indicator that is a black outline - it turns red after >selection. > >When we use Tk 8.5.7, all radio buttons and check buttons display red. >The selected button has a _tiny_ black dot to indicate whether it was >selected. > >So, if one wants to use Tk 8.5, but wants the look of Tk 8.4, are they >out of luck, or just have to write from scratch their own widgets? Or >is there a way, via options, etc. to achieve the original look? > > Yes, this is an intentional break in look and behavior. You should not term it original look, though. The critical part is the altered behavior: In motif and tk 8.4 there are two types of radio and checkbuttons grouped without indicators and stand-alone with indicators. The indicator checkbutton must be a iconic representation of a grouped checkbutton. Microsoft Windows and all other windowing systems feature grouped radio and checkuttons, today. This is the reason why microsoft switched to the motif look-a-like versions in Vista, albeit seeing to some historic resemblance... The windows 95 versions were called checkentry and radioentry, making them akin to the entry windows --OK for Windows 95. -roger |