Hi. What are the Xresources of wish? I.e., how do I change the
fore/background for any or all wish-based applications? How do I
change the top and bottom shadow colors?
The reason I ask this is because wish widget-ary on Alpha/OSF1
has some ghost grey lines near widgets. I suspect it's some remaining
of assuming the blackground is some specific grey. I tried to gather
data from editres, but it seems wish doesn't comply with the editres
protocol. It would be great if we could change tcl/tk applications
low-level aspect by the usual means of resource manipulations. Don't
you agree?
Regards,
--
*** Rodrigo Martins de Matos Ventura, alias <Yoda>
*** nu...@isr.ist.utl.pt, http://www.isr.ist.utl.pt/~nuron
*** Instituto Superior Tecnico, Lisboa, Portugal
*** PGP Public Key available on my homepage
*** Key fingerprint = 0C 0A 25 58 46 CF 14 99 CF 9C AF 9E 10 02 BB 2A
According to Rodrigo Ventura <nu...@isr.isr.ist.utl.pt>:
:
: Hi. What are the Xresources of wish? I.e., how do I change the
:low-level aspect by the usual means of resource manipulations. Don't
:you agree?
No, I don't agree. It's my understanding that editres is based on
Xt. Adding Xt support to tk would slow it down.
Perhaps you would be happier with one of the Xt based X toolkits, such
as tclMotif or Visual Tcl from SCO.
--
Larry W. Virden INET: lvi...@cas.org
<URL:http://www.teraform.com/%7Elvirden/> <*> O- "We are all Kosh."
Unless explicitly stated to the contrary, nothing in this posting should
be construed as representing my employer's opinions.
In article <5f9c0j$3...@csa21s4m.cas.org> lvi...@cas.org writes:
>According to Rodrigo Ventura <nu...@isr.isr.ist.utl.pt>:
>:
>: Hi. What are the Xresources of wish? I.e., how do I change the
>
>:low-level aspect by the usual means of resource manipulations. Don't
>:you agree?
>
>No, I don't agree. It's my understanding that editres is based on
>Xt. Adding Xt support to tk would slow it down.
>
>Perhaps you would be happier with one of the Xt based X toolkits, such
>as tclMotif or Visual Tcl from SCO.
>
I don't want Xt nor more extensions to tcl/tk. In fact I
didn't knew that tk had discarded Xt. I suppose tk builds its widgets
right on top of Xlib. The term widget may not be even accurate, since
tk 'widgets' probably have a different structure. And if Xt is
discarded, then I suppose the X resources are completly useless as fas
as tk is concerned. Am I right?
Anyway, my original question still stands. If there is no X
resources, then how can I change the basic aspect of tk? For instance,
I have a concrete problem: the BACKSPACE key doesn't work correctly
with tk entry 'widgets'. It seems there is a DEL/BACKSP swap
problem. xmodmap is no solution, since that would change all other
applications.
Yet, there is one thing that I still find intriguing: the fact
that tk picks the background color correctly. All tk widgets have the
same background color, and that is specified via resources somewhere
in the system (DEC Alpha).
Tk uses the .Xdefaults file and RESOURCE_MANAGER property
(usually set by xrdb) in the same fashion as Xt.
Why not read the manual pages on wish and the option command,
by the way? They tell you a little more about this topic.
Cheers /F
According to Rodrigo Ventura <nu...@isr.isr.ist.utl.pt>:
: I don't want Xt nor more extensions to tcl/tk. In fact I
:didn't knew that tk had discarded Xt. I suppose tk builds its widgets
Tk never used Xt. As I seem to recall, in the very first Tk article
written (see the documentation directory and the file tk4.0.ps
for details I believe), Dr. O discusses the fact that Xt plus a widget
set creates too 'heavy' a cost to the size and speed of the program.
:discarded, then I suppose the X resources are completly useless as fas
:as tk is concerned. Am I right?
No, in fact a _type_ of X resources are available. However, you need
to read the man pages for wish and the Tk option command to learn
how this works. Also, I expect that the Tk FAQ has a number of
pointers on using this - at least, the old one used to.
:resources, then how can I change the basic aspect of tk? For instance,
:I have a concrete problem: the BACKSPACE key doesn't work correctly
:with tk entry 'widgets'. It seems there is a DEL/BACKSP swap
:problem. xmodmap is no solution, since that would change all other
:applications.
Sounds to me like you need either a bind set or you need to modify the
tk scripts that are invoked upon initialization.
: Hi. What are the Xresources of wish? I.e., how do I change the
: fore/background for any or all wish-based applications? How do I
: change the top and bottom shadow colors?
Refer to Welch's Pratical programming in Tcl/Tk.
There is a section showing how to access Xresources
via a procedure in Tk. (or download a file called
filecomplete.tcl.gz from neosoft)
--
Jit Kiat Tan
Warwick University
Computer System Engineering 3rd year
Tk understands resources, although slightly differently than Xt.
If your Tcl/Tk script is named "foo", then it will be affected
by resources that begin with "Foo."
Foo*background: blue
If you read the man pages for the widgets, or use my book,
you can see what resources affect each widget.
As for bindings, you cannot fix those directly with resources.
You can dive into the scripts in the Tk library and try to
undo your DEL/BACKSP problem. Note the capitalization of
Delete and BackSpace...
> I don't want Xt nor more extensions to tcl/tk. In fact I
>didn't knew that tk had discarded Xt. I suppose tk builds its widgets
>right on top of Xlib. The term widget may not be even accurate, since
>tk 'widgets' probably have a different structure. And if Xt is
>discarded, then I suppose the X resources are completly useless as fas
>as tk is concerned. Am I right?
> Anyway, my original question still stands. If there is no X
>resources, then how can I change the basic aspect of tk? For instance,
>I have a concrete problem: the BACKSPACE key doesn't work correctly
>with tk entry 'widgets'. It seems there is a DEL/BACKSP swap
>problem. xmodmap is no solution, since that would change all other
>applications.
> Yet, there is one thing that I still find intriguing: the fact
>that tk picks the background color correctly. All tk widgets have the
>same background color, and that is specified via resources somewhere
>in the system (DEC Alpha).
--
-- Brent Welch Sun Labs brent...@eng.sun.com
See the "options" and "option" manual entries that come with Tk.
(Not sure about "top and bottom shadow colors" though; try changing
the border width, perhaps.)
For example, in wish, you can do this:
pack [button .b1 -text b1]
option add *Button.background yellow
pack [button .b2 -text b2]
You can also set default options using X resources.
For example, in your shell, type
echo "*Button.background: green" | xrdb -merge -
then in wish, type
pack [button .b1 -text b1]
Make the pattern more specific than "*Button" to restrict the effects
to particular applications. Then put your patterns in your ~/.Xdefaults
and "xrdb -load" them in your X windows start-up file.
> The reason I ask this is because wish widget-ary on Alpha/OSF1
> has some ghost grey lines near widgets. I suspect it's some remaining
> of assuming the blackground is some specific grey.
Could you be running out of colours? Are some widget borders white?
Another possibility is unwanted Xdefaults -- I have seen this happen
often when new staff "inherit" old staff's home directories which
contain configuration for legacy applications. Try going
xrdb -query
If you don't understand the output, go
xrdb -load /dev/null
then run your Tk application or the Tk "widget" demo.
You should then get Tk's compiled-in default appearance.
> I tried to gather
> data from editres, but it seems wish doesn't comply with the editres
> protocol.
tkinspect is the Tk equivalent of editres (and then some!):
http://www.osf.org/%7Eloverso/tcl-tk/tkinspect-full.tar.gz
> It would be great if we could change tcl/tk applications
> low-level aspect by the usual means of resource manipulations. Don't
> you agree?
Yes. I have seen so many tasteless, ugly looking apps. Eg,
- Gratuitous relief, eg, raised labels that look like buttons
- Poor contrast text foreground/background, eg, blue on dark grey
- Fonts too small to read
- Colour-hungry toolbars -- many people only have 256 colours
It is more work in Tk to separate appearance code from behaviour code,
but it is nicer when you can change the appearance without having to
"mess with" the application code. There doesn't seem to be a Standard
way to do this, unfortunately. (Currently I put a ruled-off "options"
section at the top of my scripts; however, no one else has to use my
scripts...)
Regarding your backspace/delete problems, are you running Linux?
The Linux defaults for backspace/delete are (IMHO) poorly chosen.
They're wrong at the lowest level; some applications use work-arounds,
but that's still just a band-aid. If you ARE using Linux, there's
a whole section in the Keyboard How-To about backspace/delete.
(Personally I "fixed" it by editing /usr/lib/kbd/keytables/us.map,
which fixes it in the virtual consoles too, although this method
is not listed in the keyboard How-To.)
--
j.c