From: taarna!mario@bloom-beacon.MIT.EDU (Mario Fortin)
Newsgroups: fj.mail-lists.x-window
Subject: Problems while using WCL 2.2
Date: 2 Sep 92 03:01:07 GMT
Distribution: fj
Organization: Workstation Div., Supermicro Systems Group, Sony Corporation

Date: 1 Sep 92 21:45:07 GMT
Message-Id: <9209012145.AA03538@taarna>
Newsgroups: comp.windows.x



This is my resources file named 'Test':
---------------------------------------
Test.wcChildren:                mainwindow
Test.allowShellResize:          True
Test.title:                     Color Editor
Test.wclResFiles:               Taarna

*mainwindow.wcCreate:           XmBulletinBoard
*mainwindow.wcChildren:         rowcolumn
*mainwindow.marginWidth:        10
*mainwindow.marginHeight:       10
*mainwindow.noResize:           True

*rowcolumn.wcCreate:            XmRowColumn
*rowcolumn.wcChildren:          rslider, gslider, bslider
*rowcolumn.marginWidth:         0
*rowcolumn.marginHeight:        0
*rowcolumn.spacing:             15

*rslider.wcClassName:           XmScale
*rslider.orientation:           XmHORIZONTAL
*rslider.minimum:               0
*rslider.maximum:               255
*rslider.showValue:             True
*rslider.width:                 255
*rslider.background:            red

*gslider.wcClassName:           XmScale
*gslider.orientation:           XmHORIZONTAL
*gslider.minimum:               0
*gslider.maximum:               255
*gslider.showValue:             True
*gslider.width:                 255
*gslider.background:            green

*bslider.wcClassName:           XmScale
*bslider.orientation:           XmHORIZONTAL
*bslider.minimum:               0
*bslider.maximum:               255
*bslider.showValue:             True
*bslider.width:                 255
*bslider.background:            blue

And this is the resources files specified in fourth line of 'Test':
-------------------------------------------------------------------
*background:                            #ccc
*XmText.background:                     gray65
*XmTextField.background:                gray65

*defaultFontList:       -*-palatino-*-r-*-*-14-*-*-*-*-*-*-*
*fontList:              -*-palatino-*-r-*-*-14-*-*-*-*-*-*-*
*buttonFontList:        -*-palatino-*-r-*-*-14-*-*-*-*-*-*-*
*labelFontList:         -*-palatino-*-r-*-*-14-*-*-*-*-*-*-*
*XmMenuShell*fontList:  -*-helvetica-medium-r-normal-*-12-*-*-*-*-*-*-*
*XmScale.fontList:      -*-helvetica-medium-r-normal-*-12-*-*-*-*-*-*-*
*XmText.fontList:       -*-helvetica-medium-r-normal-*-12-*-*-*-*-*-*-*
*XmTextField.fontList:  -*-helvetica-medium-r-normal-*-12-*-*-*-*-*-*-*


Here is the little test program:
--------------------------------
#include <X11/Xm/Xm.h>          /* Motif and Xt Intrinsics      */
#include <X11/Wc/WcCreate.h>    /* Widget Creation Library      */
#include <X11/Xmp/Xmp.h>        /* Motif Public widgets etc.    */

static XrmOptionDescRec options[] = {
    WCL_XRM_OPTIONS
};

main(int argc, char *argv[])
{
    Widget       appShell;
    XtAppContext appContext;

    appShell = XtAppInitialize (&appContext, "Test", options, XtNumber(options),                                &argc, argv, NULL, NULL, 0); 

    XmpRegisterAll(appContext);

    if ( WcWidgetCreation(appShell) != 0 ) exit(1); 

    XtRealizeWidget(appShell);
    XtAppMainLoop(appContext);
}



The resources files 'Test' and 'Taarna' are placed within
a directory named 'app-defaults' within the current directory,
while the binary of the test program is placed within the
current directory.

I set the following environment variables in this way:

  setenv XAPPLRESDIR ./app-defaults/
  setenv XUSERFILESEARCHPATH ./app-defaults/%N

and run the program:

  ./test

The following warning message is displayed and the resource
file 'Taarna' is not merged:

Wcl Warning: WcLoadResourceFile(Taarna) - Failed - file not found.


If i do the following:

   unsetenv XUSERFILESEARCHPATH
   ./test      (XAPPLRESDIR is used instead of XUSERFILSEARCHPATH)

No error message was displayed, but the resources file 'Taarna'
was not merged(not taking account-> the background should be gray).


But if i replace the line 'Test.wclResFiles: Taarna' by
'Test.wclResFiles: ./app-defaults/Taarna', the resources file
'Taarna' is well loaded and all work well.

Also, if i move the 'Taarna' resource file within the current
directory(instead of the replacement above), all work well too.

   mv ./app-defaults/Taarna .
   ./test



It seems that the function 'WcLoadResourceFile' does not
work properly in some cases. I scan the source of this function,
and i think the call to 'XtResolvePathname' is not always good.
When the 'path' parameter of this function is NULL, the function
look for the environment variable XFILESEARCHPATH not XUSERFILESEARCPATH.

But i'm not sure where is the problem!


Is someone know what is the problem here, or is someone
has already encountered the problem??


Please reply by e-mail, i haven't direct access to usenet.
---------------------------------------------------------------
Mario Fortin         mario@taarna.UUCP
System Analyst       Taarna System Inc.
                     305 De la Commune Ouest, Suite 100,
                     Montreal, Canada H2Y 2E1  (514) 844-9034