[Gtk-sharp-list] GConf Sharp question
Jeff Perrin
jeffperrin@shaw.ca
Sat, 23 Nov 2002 19:07:40 -0700
I'm currently in the process of learning how gconf-sharp actually works,
and came across a little issue in the test app I created. I have a
working form that alters the gnome background properties (from schema
file "desktop_gnome_background.schemas"). However, it seems that a
couple of the properties from the schema file (color_shading_type,
picture_opacity, and picture_options) are of type 'string', when the
available options would be better off stored as an enum of strings.
Here's a relevant section from the sample.schema file in the
samples/GConf dir of gtk-sharp CVS:
<schema>
<key>/schemas/apps/gconfsharp/sample_app/the_first_enum</key>
<applyto>/apps/gconfsharp/sample_app/the_first_enum</applyto>
<owner>sample_app</owner>
<type>string</type>
<cstype class="Sample.Names">enum</cstype>
<locale name="C"></locale>
<default>Bob</default>
</schema>
and here's an example of what I see in desktop_gnome_background.schemas:
<schema>
<key>/schemas/desktop/gnome/background/picture_options</key>
<applyto>/desktop/gnome/background/picture_options</applyto>
<owner>gnome</owner>
<type>string</type>
<default>stretched</default>
<locale name="C">
<short>Picture Options</short>
<long>Determines how the image set by wallpaper_filename is
rendered. Possible values are "none", "wallpaper", "centered",
"scaled",
"stretched".</long>
</locale>
</schema>
Notice the line:<cstype class="Sample.Names">enum</cstype> in the first
example.
Therefore, how would I bind the available options from the second
example to something like a drop down list, which would be far more
user-friendly (as opposed to using a Text Entry). Take a look at the
screenshot here:
http://members.shaw.ca/mailtrap/Screenshots/GConfBGSettings.png
Hopefully someone can understand what I mean and give me some solid
feedback...
Regards,
Jeff Perrin