How to get all choices from GSettings schema

I have a key of the choices type in GSettings schema:

<key name="some-key" type="s">
    <choices>
        <choice value"one"/>
        <choice value"two"/>
        <choice value"three"/>
    </choices>
    <default>"one"</default>
</key>

But I can’t figure out how to get all choices of this key? Apparently, I have to use the Gio.SettingsSchemaKey.get_range() for this, but I can’t figure out how to get/create an object of this type?

You have to get the GSettingsSchemaSource, either created for your own schema or from the default system sources (XDG dirs, etc.), then from there get a GSettingsSchema from lookup (possibly recursive if using the default), then from there you can get the GSettingsSchemaKey. The docs have examples, see e.g.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.