- XrmDatabase homeDB, serverDB, applicationDB;
- char filenamebuf[1024];
-
- char *filename = &filenamebuf[0];
- char *environment;
- char *classname = gdk_progclass; // Robert Roebling ??
- char name[256];
- (void)strcpy(name, "/usr/lib/X11/app-defaults/");
- (void)strcat(name, classname ? classname : "wxWindows");
-
- // Get application defaults file, if any
- if ((applicationDB = XrmGetFileDatabase(name)))
- (void)XrmMergeDatabases(applicationDB, &wxResourceDatabase);
-
- // Merge server defaults, created by xrdb, loaded as a property of the root
- // window when the server initializes and loaded into the display
- // structure on XOpenDisplay;
- // if not defined, use .Xdefaults
- if (XResourceManagerString(GDK_DISPLAY()) != NULL)
- {
- serverDB = XrmGetStringDatabase(XResourceManagerString(GDK_DISPLAY()));
- }
- else
- {
- (void)GetIniFile(filename, (char *) NULL);
- serverDB = XrmGetFileDatabase(filename);
- }
- if (serverDB)
- XrmMergeDatabases(serverDB, &wxResourceDatabase);
-
- // Open XENVIRONMENT file, or if not defined, the .Xdefaults,
- // and merge into existing database
-
- if ((environment = getenv("XENVIRONMENT")) == NULL)
- {
- size_t len;
- environment = GetIniFile(filename, (const char *) NULL);
- len = strlen(environment);
-#if !defined(SVR4) || defined(__sgi)
- (void)gethostname(environment + len, 1024 - len);
-#else
- (void)sysinfo(SI_HOSTNAME, environment + len, 1024 - len);
-#endif
- }
- if ((homeDB = XrmGetFileDatabase(environment)))
- XrmMergeDatabases(homeDB, &wxResourceDatabase);
+ wxString filename( file );
+ if (filename.IsEmpty()) filename = wxT(".wxWindows");
+
+ wxFileConfig conf( wxTheApp->GetAppName(), wxTheApp->GetVendorName(), filename );
+
+ conf.SetPath( section );
+
+ return conf.Write( entry, value );