So, what are some common steps developers are using to update their
applications when faced with this situation?
I pointed the developer to the Tk 8.5 widget demos, and suggested he
take a look at the ttk radiobutton, but of course, all of his classic
tk radiobutton configuration flags no longer work, and after removing
them all, the resulting ttk radiobutton group doesn't fit the rest of
his application's look.
Do any of the demos that come with the Tk sources demonstrate this
problem?
If not, is there some short script which does?
Some actual code to examine and test would permit some determination
whether the problem lies in changes to Tk or in problems with the
local environment.
--
| Don Porter Mathematical and Computational Sciences Division |
| donald...@nist.gov Information Technology Laboratory |
| http://math.nist.gov/~DPorter/ NIST |
|______________________________________________________________________|
Here's an example script which demonstrates a difference in size (If
the developer gets back with me with his specific code, I can be more
specific):
package require Tk
set ::onetwothree "3"
pack [radiobutton .one -value "WNBC" -text "New York" -variable
onetwothree -command { puts "Play $::onetwothree" }]
pack [radiobutton .two -value "KDKA" -text "Pittsburgh" -variable
onetwothree -command { puts "Play $::onetwothree" }]
pack [radiobutton .three -value "WGN" -text "Chicago" -variable
onetwothree -command { puts "Play $::onetwothree" }]
Interestingly enough, I tried the "tk::classic::restore" command, as
mentioned by Jeff Hobbes on the wiki, and with that, at least the size
of the radiobutton window now appears the same. The indicator shape is
still a circle instead of the classic diamond, but at least the sizing
is the same.
So the size change is probably part of the Tk 8.5 beautification
project.
The Tk 8.5 classic radiobutton man page says:
A radiobutton is a widget that displays a textual string, bitmap
or image and a diamond or circle called an indicator.
Does anyone know how I could get the classic Tk radiobutton to use the
diamond indicator?
You can't, since that's unable to support all the features that 8.5
supports (notably tristate-ness).
Donal.
Keep using Tk 8.4.
Another choice would be to create two custom images that mimic the old
look, and use those with the radiobuttons. That might be the quickest
road to a solution.
::tk::classic::restore may help in some regards, but who knows how long it
will last? It's in a file called obsolete.tcl in the Tk library. The
defaults were changed for Tk widget options in 8.5.
TTK widgets don't support per-widget options very easily, if at all. I've
debated/argued with Joe and Pat about this before. The native themes don't
support per-widget options, such as text colors for widgets, so in some
cases you can't use TTK widgets. It's possible to support more
customization of native widgets for Windows, and the Mac, but for various
reasons it seems the developers of Tile/TTK have decided against this.
For some people this is acceptable. For others it isn't.
As it is, I only have 1 Tk app using ttk now. I used to have 4 apps using
Tile, before I decided against that. Some people could use a better
alternative.
--George
Okay - the man page reference to the diamond indicator led me to
believe there was some way, even if it were something like the classic
restore "trick".
Thanks!
I have a projekt "Gestalt Items",
which allows to replace the design for
the radiobuttons.
Well, the project is registered at sf,
but needs their "approval" before I can fill in
anything...
(need to put the sf logos inside the docs, too).
Though, Monday or Tuesday it wil be.
From the source code:
----
4688
# ➋ The checkmark
set boundaries \
[$base$w(1) create circle \
$xp $yp \
4693 -fill $linear \
-strokewidth $borderwidth \
-stroke [opget $window borderColor black] \
-r $r \
-strokeopacity [expr { 0.3 * $opacity }] \
4698 -tags [concat $tags indicator_$window] ]
set checkmark \
[$base$w(1) create circle \
4703 $xp $yp \
-stroke {} \
-strokewidth 0.0 \
-fill $foreground \
-r [expr { $r * 0.55 }] \
4708 -fillopacity [expr { $selected * $opacity }] \
-tags [concat $tags checkmark_$window]]
----
The modul uses tkpath for the rendering
and therefore CAIRO under X11.
The default design uses rounded indicators
--as seen in the code-excerpt--
You will have to replace this procedure
with your own customized version (diamond shape),
possible a rotated prect.
How it can be used with an tk and/or ttk
application is explained ––at length and detailed--
inside the documentation
--therefore, excuse me for not elaborating about it.
Inside my own code it boils down to an
additional code-line such as:
stripes .containerwindowtobeStriped 1 2 3 4 5
where "1" "2"... "3" are ordinary tk controls,
such as radiobutton maintained by stripes.
Deals with menus under X11, but in contrast
to Tk 8.4 or earlier the same code and design
is used as inside dialogs.
The name "stripes" originates from its initial
purpose: to get AQUA-stripes.
If you like to get the documentation at-once,
drop me a note to arndt...@web.de.
Well the documentation consists of three books with more
than 4MB (zipped)... better wait for the project
going public.
--roger