I am trying to create a cross-platform C # application using C #, mono / GTK # on Linux, and .NET / GTK # on Windows, however the startup sequence should apparently be slightly different depending on the two platforms:
On Linux:
public static void Main (string[] args)
{
Gdk.Threads.Init ();
On Windows:
public static void Main (string[] args)
{
Glib.Thread.Init ();
Gdk.Threads.Init ();
Both require this to be done like this: Windows complains that g_thread_init () is not being called with Linux code, and linux complains that it is already being called with Windows code. Other than that, it all works great.
My first attempt at a โsolutionโ looked like this:
public static void Main (string[] args)
{
try {
Gdk.Threads.Init ();
} catch (Exception) {
GLib.Thread.Init ();
Gdk.Threads.Init ();
}
; GTK +, , . - ? , , , , ?