GNOME Bugzilla – Bug 431021
Provide a getter to retrieve from a GOptionGroup the GOptionEntry it contains
Last modified: 2018-05-24 11:01:16 UTC
I want to support standard GTK options in my program but I don't want to use g_option_ processing macros to parse command line. Now, when I want to print the help of my program (in response to --help option, and using my own code), I need to be able to get a list of the GTK standard options processed by gtk_init. Unfortunately gtk_get_option_group() returns a GOptionGroup* which however is completely opaque and has no getters!! This means that there is no way for GTK users which do not use g_option_* parser facilities to get the list of GTK supported options. A simple gint g_option_group_get_entries(GOptionGroup group, GOptionEntry **p) { *p = group->entries; return group->n_entries; } should do the job.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/91.