|
From: Goodwin L. <goo...@uc...> - 2005-10-10 15:49:20
|
Hi Pat, I implemented your idea for a -format option for the scale widget and put the patch up here: https://sourceforge.net/tracker/index.php?func=detail&aid=1233729&group_id=11464&atid=311464 You could also use the -format option for non-numerical display. Eg ::ttk::scale .s -format "Small" -value 0 -from 0 -to 2 -command UpdateScale pack .s proc UpdateScale {val} { if {$val < 1} { .s config -format "Small" } else { .s config -format "Big" } } you could, of course, include the value: proc UpdateScale {val} { if {$val < 1} { .s config -format "%.2f - Small" } else { .s config -format "%.2f - Big" } } In the patch, I got around the overhang problem (for horizontal orientation anyway) by sticking the displayed text to the edge when it hits it (not overhanging it) and letting the slider then "catch up" as it approaches the edge. Some issues: -float->hex conversion. At the moment there's no way to get int->hex conversion (which may be what people expect). - should the widget value should be formatted the same as the displayed value (it is in tk) Having said this, I've no objections to a -displayvariable option. Goodwin |