Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!mcvax!ukc!harrier.ukc.ac.uk!rlh2 From: rlh2@ukc.ac.uk (Richard Hesketh) Newsgroups: comp.windows.x Subject: Re: Programs relying on app-defaults files (was: Re: xclipboard bug?) Keywords: app-defaults Message-ID: <1305@harrier.ukc.ac.uk> Date: 27 May 89 12:41:19 GMT References: <8905151402.AA06843@THANATOS.MIT.EDU> <773@acorn.co.uk> <1041@sragwa.sra.JUNET> <3401@hplabsz.HPL.HP.COM> Reply-To: rlh2@ukc.ac.uk (Richard Hesketh) Organization: Computing Lab, University of Kent at Canterbury, UK. Lines: 45 In article <3401@hplabsz.HPL.HP.COM> dayoung@hplabsz.UUCP (Doug A. Young) writes: [ describes and includes the following function ] >XtRegisterApplicationDefaults(). The enclosed shar file contains a patch >file for the R3 Intrinsics and a simple dummy example, [ deleted ]. >Doug Young As Bob said this probably won't be included in R4 so having patches to the source ain't a good thing ... however because the idea is so simple (WDITOT 8-) it can be made into a small utility routine that could be part of Xmu or in the source of your own program: <---<---<--- #include XmuRegisterApplicationDefaults(dpy, defs, n_defs) Display *dpy; char *defs[]; int n_defs; { XrmDatabase rdb = NULL; int i; for (i = 0; i < n_defs; i++) XrmPutLineResource(&rdb, defs[i]); if (rdb != NULL) { XrmMergeDatabases(dpy->db, &rdb); dpy->db = rdb; /* original dpy->db has been destroyed */ } } --->--->---> Note this takes the display of a widget to find the database .. so it must be used either AFTER XtInitialize has been called or .. as really should the case .. AFTER an XtOpenDisplay call. In fact it can be called anytime using ... XmuRegisterApplicationDefaults(XtDisplay(w), defs, XtNumber(defs)) etc. Richard Richard Hesketh : rlh2@ukc.ac.uk ..!mcvax!ukc!rlh2 --- Computing Lab., University of Kent at Canterbury, Canterbury, Kent, CT2 7NF, United Kingdom. Tel: (0227) 764000 ext. 3682