Article View: comp.windows.x
Article #37995bug in XtGetApplicationResources
From: Brian V. Smith
Date: Mon, 12 Mar 1990 23:56
Date: Mon, 12 Mar 1990 23:56
60 lines
2611 bytes
2611 bytes
There seems to be a bug in XtGetApplicationResources that appears
on Sun4's (4.0) but not on Vaxstations (Ultrix 3.0) or DECstation 3100
(Worksystem V2.0, which I believe is Ultrix 3.0). All are using R4 from
MIT (installed by me).
Compile with -lXt -lX11
The bug is that some resources are parsed correctly and one in particular
is not. Here is a whole program which demonstrates the point.
Run with -portrait or -P and the landscape variable should be set to 0.
This one doesn't work on a sun4.
Run with -right and justify should be set to 1. It sets justify to 16777216
instead, which is 1000000 hex (byte order problem?)
I am mailing to xbugs, but if anyone has any ideas, I would appreciate it.
_____________________________________
Brian V. Smith (bvsmith@lbl.gov)
Lawrence Berkeley Laboratory
I don't speak for LBL, these non-opinions are all mine.
-------------------- program is here ----------------------
#include <stdio.h>
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
static int true = True;
static int false = False;
int landscape = 1;
int RHS_PANEL = 0;
static XtResource application_resources[] = {
{XtNjustify, XtCJustify, XtRBoolean, sizeof(int),
(Cardinal)&RHS_PANEL, XtRBoolean, (caddr_t)&false},
{"landscape", XtCOrientation, XtRBoolean, sizeof(int),
(Cardinal)&landscape, XtRBoolean, (caddr_t)&true},
};
static XrmOptionDescRec options[] =
{
{"-right", ".justify", XrmoptionNoArg, "True" },
{"-portrait", ".landscape", XrmoptionNoArg, "False"},
};
main(argc,argv)
int argc;
char *argv[];
{
Widget tool;
tool = XtInitialize("fig", "Fig", options, XtNumber(options),
&argc, argv);
XtGetApplicationResources(tool, 0, application_resources,
XtNumber(application_resources), NULL, 0 );
fprintf(stderr,"landscape = %d, justify = %d\n",landscape,RHS_PANEL);
}
Technical Details
Message-ID:
<5061@helios.ee.lbl.gov>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!usc!ucsd!helios.ee.lbl.gov!epb2.lbl.gov!envbvsShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!usc!ucsd!helios.ee.lbl.gov!epb2.lbl.gov!envbvs From: envbvs@epb2.lbl.gov (Brian V. Smith) Newsgroups: comp.windows.x Subject: bug in XtGetApplicationResources Keywords: incorrect parsing of resources on sun 4 Message-ID: <5061@helios.ee.lbl.gov> Date: 12 Mar 90 23:56:44 GMT Sender: usenet@helios.ee.lbl.gov Reply-To: envbvs@epb2.lbl.gov (Brian V. Smith) Organization: lbl Lines: 60 X-Local-Date: 12 Mar 90 15:56:44 PST