On Fri, 21 Dec 2007 09:20:02 -0700, Michal Kurgan michal.kurgan@moloh.net wrote:
On Fri, 21 Dec 2007 11:30:45 +0100 Enrico Tröger enrico.troeger@uvena.de wrote:
Better use "gtk_init_check" to not force termination or
[ ... ] So the only possibility we have (AFAIK) is to manually parse the commandline options(maybe with popt) but I don't want to add this.
Then use "gtk_get_option_group" and "g_option_context_parse". It is used in other gtk and gnome application to connect application specific and standard gtk options. Look at the sources for examples (ie. evince[1] ).
Thanks for the hint, it's working now. The trick is to pass FALSE to gtk_get_option_group(). After doing this, all command line options also work on a plain text console without a valid X display. This may cause other problems but I don't care. When an user is using a GUI app on a plain text console, he should expect problems.
Regards, Enrico