Re: How to determine if Gtk+ had been initialized
- From: David Nečas (Yeti) <yeti physics muni cz>
- To: gtk-app-devel-list gnome org
- Subject: Re: How to determine if Gtk+ had been initialized
- Date: Wed, 18 Oct 2006 22:53:04 +0200
On Wed, Oct 18, 2006 at 10:34:51PM +0200, Paul Plaquette wrote:
an application is using GTK+
It calls functions provide in a shared libary.
the library could present user interface based on GTK+ or not
depending on the application initialized Gtk+ or not (calling gtk-init
()).
This sounds a bit strange. Shouldn't the application
tell the library whether it wants GUI or not?
The question is : from the library, is there a way to know the caller
had initialized Gtk+ ?
There is no way to get the value of gtk_initialized from
gtkmain. A fairly safe check for a GUI running is
if (gtk_main_level() > 0)
...
However this fails when Gtk+ is initialized but no main loop
is running.
Yeti
--
Whatever.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]