Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!dali.cs.montana.edu!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!wuarchive!udel!rochester!kodak!ispd-newsserver!ism.isc.com!b1!ico!auto-trol!marbru From: marbru@auto-trol.com (Martin Brunecky) Newsgroups: comp.windows.x Subject: Re: Wcl Question Message-ID: <1991May10.165839.16637@auto-trol.com> Date: 10 May 91 16:58:39 GMT References: <1086@venice.SEDD.TRW.COM> Sender: news@auto-trol.com Distribution: usa Organization: Auto-trol Technology Corporation Lines: 46 Nntp-Posting-Host: server_1-gw In article <1086@venice.SEDD.TRW.COM> diaz@venice.sedd.trw.com (Phillip Diaz) writes: >A question to you Wcl users. I would like to read multiple >resource files while in one application loop. Considering my >first run through the code would look like this: .... >______________________________________________________________________ > >How do I go about reading in other resource file while the current >display is up at running? I've tried this, but maybe I'm just grasping >at potential problems, any help? >______________________________________________________________________ > > appShell = XtAppCreateShell(appName, appClass, > applicationShellWidgetClass, > display, > NULL, 0); > > resfile = (char *) malloc (strlen(window_file) + 1); > strcpy (resfile, window_file); > WcLoadResourceFileCB (appShell, resfile, NULL); > > /* -- Create widget tree below toplevel shell using Xrm database */ > WcWidgetCreation (appShell); Sounds like your "window_file" does not use the proper shell widget name, i.e. if appName here is "foo", the file must define "foo.wcChildren: ...". Also, if you don't want to get confused by the resources from the previous/initial "loop", you may consider the following: After the app initialization, make a copy of the Xrm databse containing all the resources gained through the Xt search pattern. In each loop, destroy the current dpy->dp and replace it with a copy of the "initial one", then load the new resource file(s). This will prevent your Xrm databse from growing (it won't grow if you constantly overwrite the same resources, but is this the case?). The Wcl code can be used as a guide ... -- =*= Opinions presented here are solely of my own and not those of Auto-trol =*= Martin Brunecky marbru%auto-trol@sunpeaks.central.sun.com (303) 252-2499 (better avoid: marbru@auto-trol.COM ) Auto-trol Technology Corp. 12500 North Washington St., Denver, CO 80241-2404