home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / windows / x / 21602 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  2.2 KB

  1. Xref: sparky comp.windows.x:21602 comp.windows.x.intrinsics:802
  2. Path: sparky!uunet!ulowell!m2c!bu.edu!decwrl!csus.edu!netcom.com!richm
  3. From: richm@netcom.com (Richard Mauri)
  4. Newsgroups: comp.windows.x,comp.windows.x.intrinsics
  5. Subject: Using Xrm routines in widget code to provide persistence
  6. Message-ID: <1993Jan26.190404.6803@netcom.com>
  7. Date: 26 Jan 93 19:04:04 GMT
  8. Followup-To: poster
  9. Organization: Netcom - Online Communication Services  (408 241-9760 guest)
  10. Lines: 46
  11.  
  12.  
  13. The XJournal issue Jan-Feb 1993 has an article titled
  14. "Modifying user preferences". It deals with using the Xrm
  15. Xlib resource management routines to provide a facility
  16. for loading/saving resources to a user resource database.
  17.  
  18. This seems like a good way for a custom widget of mine
  19. to be able to acquire persistence-like functionality. 
  20. I'd like each instance of the widget to read/write a resource 
  21. file and merge the results with those loaded by Xt. 
  22. Maybe I could have a resource file named XtName(my_widget) 
  23. and each time an instance of that name is created I could 
  24. read this resource file and then merge the databases.
  25.  
  26. Unfortunately I am having some dificulty , i.e, bus errors
  27. down under XrmPutFileDatabase(). It seems straight forward
  28. enough, but I am at a loss... Here's what I'm trying
  29.  
  30. To read the resource file is: (No problems)
  31. a) db = XrmGetFileDatabase()
  32. b) iterate over all my resources using XrmGetResource()
  33. c) override the resources set by Xt in my Initialize()
  34.    (This is a manual merge, I know.)
  35.  
  36. To save the resource file: (Problems in XrmPutFileDatabase)
  37. a) db2 = XrmGetStringdatabase("")
  38. b) iterate over all my resources using XrmPutLineStringResource() into db2
  39. c) Use XrmPutFileDatabase(dp2, path_to_my_resource_file)
  40. d) Should I XrmDestroyDatabase(db2)
  41.  
  42. Does anyone know:
  43. 1. Where the source to this Xjournal article is.
  44.     I've checkes export and uunet and only jan 92 is available.
  45. 2. Where I could get some examples of this
  46. 3. Better way to provide persistence using the resource mechanism
  47.     with respect to having a widget be able to get/save it's
  48.     custom resources.
  49. 4. If I'm totally clueless
  50.  
  51. Thanks, Rich
  52. -- 
  53. Richard Mauri 
  54. Software Engineer/Boardhead
  55. Trimble Navigation Ltd.
  56. email: richard_mauri@Trimble.com
  57. email: richm@netcom.com
  58.