Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!samsung!sdd.hp.com!decwrl!sgi!shinobu!odin!eukanuba.wpd.sgi.com!mikey From: mikey@eukanuba.wpd.sgi.com (Mike Yang) Newsgroups: comp.windows.x Subject: Re: Need help with D.Young's example? Message-ID: <1990Aug22.163712.16456@odin.corp.sgi.com> Date: 22 Aug 90 16:37:12 GMT References: <1990Aug21.235152.8328@cbnewsh.att.com> Sender: news@odin.corp.sgi.com (Net News) Reply-To: mikey@sgi.com Distribution: usa Organization: Silicon Graphics, Inc. Lines: 35 In article <1990Aug21.235152.8328@cbnewsh.att.com>, wolf@cbnewsh.att.com (thomas.wolf) writes: |> In Chapter 12's example of the simple "Dial" widget, some defaults are |> set in Dial.c (foreground, indicatorColor, etc.) in the resources[] array. |> I found that modifying these defaults and recompiling resulted in the |> expected changes at run-time, _except_ when I changed the defauts for |> XtNforeground. No matter what color I specified, the program would always |> set the foreground color to "Black" (ie. the little line segments in his |> dial widget would always be black.) |> |> If, on the other hand, I specify the foreground color at run-time (with |> the command-line option '-fg') it is correctly displayed by the program. The XtResource list for the Dial widget doesn't specify resource values -- it specifies resources used and gives default values. The reason why changing the defaults worked for all the resources other than XtNforeground is that these resources probably didn't have specified values (they're unique to Dial) so their defaults are used. XtNforeground, however, is a common resource. If you specify some value for it (e.g. your .Xdefaults) somewhere, its default will never be used. Using the -fg switch overrides whatever specification is out there, so its effect is noticable. ----------------------------------------------------------------------- Mike Yang Silicon Graphics, Inc. mikey@sgi.com 415/335-1786