The task is:
It is necessary that according to the flag passed to the application, for example:
"app.exe -t gui" or " app.exe -t console"
the application ran in either GUI or console mode, depending on the flag.
And here is code written all works under Windows, but not under Linux!
When I run my app under Windows, like this:
"app.exe -t gui" - I see forms and accordingly my GUI.
When I'm running my app under Windows like this:
"app.exe -t console " it works as a console and everything is fine
BUT when I run my application under Linux, like this:
"app -t gui "of course if X is started then everything is fine, otherwise I see an error: "Gtk-WARNING **: time: cannot open display" and it is clear.
BUT when I run my application under Linux, like this:
"app -t console "that if X is started all is good BUT if is not present, I see an error:" Gtk-WARNING **: time: cannot open display " though I do not use at runtime on ANY GUI elements.
Attention my questions:
1. How can I not initialize GTK from my application code at runtime ?
2. Where do I get the message "Gtk-WARNING **:..."?