gconf-sharp
0.0.0.0
neutral
Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details.
Basic functions to initialize GConf and get/set values.
The following example attempts to retrieve a setting from GConf, and set a default value otherwise.
string MyVal;
GConf.Client gconfClient = new GConf.Client ();
try
{
MyVal = (string) gconfClient.Get ("/apps/monoapps/SampleApp/setting1"));
}
catch (GConf.NoSuchKeyException)
{
gconfClient.Set ("/apps/monoapps/SampleApp/setting1", "sample");
}
GConf.ClientBase
Method
System.Void
Suggests that you have just finished a block of changes, and it would be an optimal time to sync to permanent storage.
This function is just a "hint" provided to maximize efficiency and minimize data loss.
Method
System.Void
Removes a notification request.
an object of type
an object of type
Method
System.Void
Registers a notification request.
an object of type
an object of type
To be added
Constructor
Creates a new .
an object of type
This is the default constructor for .
Method
System.Object
Gets a value from the GConf source.
an object of type
an object of type
Normally you will need to convert the value to the correct type before using it.
Here is how you could set a to use the system-wide setting for style.
// assuming you have a Gtk.Toolbar named toolbar1
string val;
try
{
GConf.Client gconfclient = new GConf.Client ();
val = (string) gconfclient.Get ("/desktop/gnome/interface/toolbar_style");
}
catch (GConf.NoSuchKeyException)
{
val = "both";
}
switch (val) {
case "both":
toolbar1.ToolbarStyle = Gtk.ToolbarStyle.Both;
break;
case "text":
toolbar1.ToolbarStyle = Gtk.ToolbarStyle.Text;
break;
case "both_horiz":
toolbar1.ToolbarStyle = Gtk.ToolbarStyle.BothHoriz;
break;
default:
toolbar1.ToolbarStyle = Gtk.ToolbarStyle.Icons;
break;
}