gnome-config problems
- From: Sarah Mount <s mount coventry ac uk>
- To: gnome-devel-list gnome org
- Subject: gnome-config problems
- Date: Mon, 19 Feb 2001 18:34:48 +0000 (GMT)
I've been using gnome_config to store user prefs, but
gnome_config_set_string() doesn't appear to be working. FWIW I'm using the
following:
gnome-core-devel-1.2.4-0_helix_1
gnome-libs-devel-1.2.8-0_helix_1
gnome-libs-1.2.8-0_helix_1
gtk+10-1.0.6-6
gtk+-1.2.8-0_helix_1
gtk+-devel-1.2.8-0_helix_1
and writing in C.
Code and results below.
Thanks in advance,
Sarah
--------------------------------
#include <gnome.h>
#include <gtk/gtk.h>
#include <libgnome/gnome-config.h>
#include "main.h"
#include "interface.h"
#include "support.h"
#include "prefs.h"
/*
* This is actually defined elsewhere, but it's
* here for completeness.
*/
static gboolean DEBUG = TRUE;
void write_prefs() {
GtkWidget *gnome_latex_file;
gchar *latex_file;
/* What value has the user set? */
gnome_latex_file = lookup_widget(GTK_WIDGET(preferences),
"prefs_latex_file_entry");
latex_file = gnome_file_entry_get_full_path
(GNOME_FILE_ENTRY(gnome_latex_file),
FALSE);
/* Save the value in gnome_config stuff */
if (latex_file != NULL) {
gnome_config_set_string("/gRef/General/latex_file/",
latex_file);
/*
* It doesn't seem to matter if I call
* gnome_config_sync() here or not.
*/
gnome_config_sync();
if (DEBUG) {
g_print("config_set_string:\n");
g_print(latex_file);
g_print("\nValue in gnome-config:\n%s\n",
gnome_config_get_string
("/gRef/General/latex_file/"));
}
}
}
--------------------------------
Which prints the following, when it's run:
config_set_string:
/home/snim2/src/c/gRef/glade/tests/foo
Value in gnome-config:
(null)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]