[comp.windows.x.motif] Conditional Resources

sean@mitchell.eos.scg.hac.com (Sean Cohan) (04/05/91)

Is it possible to specify in the app-defaults file a conditional if statement?
I want my x, y, width, and height values to be one set of values if the display
is a Sun 19" monitor, and I want them to be another set of values if the display
is a Mac 14" monitor. 

Thanks.

kit@mycroft.ics.com (Chris D. Peterson) (04/09/91)

> Is it possible to specify in the app-defaults file a conditional if statement?
> I want my x, y, width, and height values to be one set of values if the display
> is a Sun 19" monitor, and I want them to be another set of values if the display
> is a Mac 14" monitor.

There is currently no support for this in the Application Defaults file.


					Chris D. Peterson     
					Integrated Computer Solutions, Inc.

Net:	 kit@ics.com
Phone:   (617) 621 - 0060
Address: 201 Broadway, Cambridge, MA 02139

masa@hpsciz.sc.hp.com (Masayoshi Habu) (04/10/91)

In comp.windows.x.motif, sean@mitchell.eos.scg.hac.com (Sean Cohan) writes:

> Is it possible to specify in the app-defaults file a conditional if
> statement? I want my x, y, width, and height values to be one set of
> values if the display is a Sun 19" monitor, and I want them to be
> another set of values if the display is a Mac 14" monitor. 

Nice if we could. But there is another solution for this. Your X server
is usually invoked from a start up script which is called .xinitrc or
something like that in your home directly. In this script, you can load
resources into your X server by xrdb command. This script is no more
than a simple shell script, so you have control scructures like 'if'.

Resources loaded to X server by xrdb take precedence over app-defaults.
Please note that xrdb can pass your resource file through cpp, so you
have another place where control structure like '#ifdef' is available.

I setup .Xresources file in my home directory and let xrdb read this
file as well as .Xdefaults. My .Xresources file has a bunch of cpp
directives to select the right fonts and colros for various displays
from B&W 16" to 8-plane color 19".

Masa Habu

tp@mccall.com (Terry Poot) (04/19/91)

In article <13270008@hpsciz.sc.hp.com>, masa@hpsciz.sc.hp.com (Masayoshi
Habu) writes:
>In comp.windows.x.motif, sean@mitchell.eos.scg.hac.com (Sean Cohan)
>writes:
>
>> Is it possible to specify in the app-defaults file a conditional if
>> statement? I want my x, y, width, and height values to be one set of
>> values if the display is a Sun 19" monitor, and I want them to be
>> another set of values if the display is a Mac 14" monitor. 
>
>Nice if we could. But there is another solution for this. Your X
>server
>is usually invoked from a start up script which is called .xinitrc or
>something like that in your home directly. In this script, you can
>load
>resources into your X server by xrdb command. This script is no more
>than a simple shell script, so you have control scructures like 'if'.
>
>Resources loaded to X server by xrdb take precedence over
>app-defaults.
>Please note that xrdb can pass your resource file through cpp, so you
>have another place where control structure like '#ifdef' is available.
>
>I setup .Xresources file in my home directory and let xrdb read this
>file as well as .Xdefaults. My .Xresources file has a bunch of cpp
>directives to select the right fonts and colros for various displays
>from B&W 16" to 8-plane color 19".

Can anyone using Motif on VMS tell me how to do the equivalent of this on
VMS? I did it the way the release notes said, which means that I can only
use one workstation type or everything will be screwed up. We have 2
workstations, one B&W, and one 4 plane grayscale. We may be getting a new
one which will be 8 plane grayscale, with a different screen size. *sigh*.
--
Terry Poot <tp@mccall.com>                   The McCall Pattern Company
(uucp: ...!rutgers!ksuvax1!deimos!mccall!tp) 615 McCall Road
(800)255-2762, in KS (913)776-4041           Manhattan, KS 66502, USA