GThread + GTK+ on windows - problem



hello!

I'm trying to compile this code under Windows using DevC++ and GTK+ stuff from http://gladewin32.sourceforge.net/ :

My DevC++ is well configured because I can compile and run single thread GTK+ application or compile and run console program using GThread witout any problems. I have problem only, when I'm trying to use GThread and GTK+ in one application.



#include <stdlib.h>
#include <gtk/gtk.h>


void create_window (void)
{
 GtkWidget *dialog = NULL;

 dialog = gtk_dialog_new ();
 gtk_widget_show (dialog);
}


int main (int argc, char *argv[])
{
 GtkWidget *window;

 g_thread_init (NULL);
 gdk_threads_init ();
 gdk_threads_enter ();

 gtk_init (&argc, &argv);
 g_thread_create (create_window, NULL, FALSE, NULL);
 //create_window ();
 //gtk_widget_show (window);

 gtk_main ();
 gdk_threads_leave ();

 return 0;

}



under Linux it works, but under windows it doesn't, can someone tell my why?



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]