Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Gtk+/Gnome Application Development
Prev Home Next

Storing Data In Configuration Files

Saving data is simply the inverse of loading it; you provide a "/file/section/key" path in just the same way, along with the value to store. Data is not written immediately; you must call gnome_config_sync() to ensure the file is written to disk.

#include <libgnome/gnome-config.h>

void gnome_config_set_string(const gchar* path, const gchar* value);

void gnome_config_set_translated_string(const gchar* path, const gchar* value);

void gnome_config_set_int(const gchar* path, gint value);

void gnome_config_set_float(const gchar* path, gdouble value);

void gnome_config_set_bool(const gchar* path, gboolean value);

void gnome_config_set_vector(const gchar* path, gint argc, const gchar* const argv[]);

void gnome_config_private_set_string(const gchar* path, const gchar* value);

void gnome_config_private_set_translated_string(const gchar* path, const gchar* value);

void gnome_config_private_set_int(const gchar* path, gint value);

void gnome_config_private_set_float(const gchar* path, gdouble value);

void gnome_config_private_set_bool(const gchar* path, gboolean value);

void gnome_config_private_set_vector(const gchar* path, gint argc, const gchar* const argv[]);

Figure 5. Saving data to configuration files

Gtk+/Gnome Application Development
Prev Home Next

 
 
  Published under free license. Design by Interspire