[Gtk-sharp-list] GConf Sharp question
Rachel Hestilow
hestilow@ximian.com
07 Dec 2002 13:58:56 -0600
--=-nCiAtZqH9fAhcfD6M+Bt
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable
Jeff,
That is a flaw in the way GConf# currently handles things. I should
have some free time this upcoming week to go back to hacking, and have
some ideas on how to fix it. In the meantime, I would advise you to
write an enum mapping out those values string-by-string, and then using
System.Enum to convert back and forth.
-- Rachel
On Sat, 2002-11-23 at 20:07, Jeff Perrin wrote:
> 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.=20
> Here's a relevant section from the sample.schema file in the
> samples/GConf dir of gtk-sharp CVS:
>=20
> <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=3D"Sample.Names">enum</cstype>
> <locale name=3D"C"></locale>
> <default>Bob</default>
> </schema>
>=20
> and here's an example of what I see in desktop_gnome_background.schemas:
>=20
> <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=3D"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>
>=20
> Notice the line:<cstype class=3D"Sample.Names">enum</cstype> in the first
> example.
>=20
> 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:
>=20
> http://members.shaw.ca/mailtrap/Screenshots/GConfBGSettings.png=20
>=20
> Hopefully someone can understand what I mean and give me some solid
> feedback...
>=20
> Regards,
>=20
> Jeff Perrin
>=20
>=20
>=20
>=20
> _______________________________________________
> Gtk-sharp-list maillist - Gtk-sharp-list@ximian.com
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
>=20
--=-nCiAtZqH9fAhcfD6M+Bt
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQA98lMAapOJdUj74F4RAo4dAJ9A58tZO/AN8nCxwdB+T/yF9dwDHACdEwn/
UdReYAD+H+F82m9wA9XSvmU=
=bztU
-----END PGP SIGNATURE-----
--=-nCiAtZqH9fAhcfD6M+Bt--