Thread does not working!

Hi.

I have some problems in thread in W32.
First please analyze my source.

<<<
/*
yjh13 at edunet4u.net
1999nov25thu
SDL & gtk+ example.
*/

#include <stdio.h>
#include <stdlib.h>
#include “SDL.h”
#include “SDL_thread.h”
#include <gtk/gtk.h>

#ifndef TRUE
#define TRUE 0
#define FALSE !TRUE
#endif

SDL_Thread *thr;
SDL_Surface *screen;
SDL_Event event;
SDL_Rect rect;
char bl_dp;
Uint8 r,g,b;
GtkWidget *cd;

void cb_cc(GtkColorSelection *c,gpointer d) {
int i=0;
gdouble color[3];

gtk_color_selection_get_color(c,color);
r=(Uint8)(color[0]*255.0);
g=(Uint8)(color[1]*255.0);
b=(Uint8)(color[2]*255.0);

}

void clearthread(void) {
SDL_KillThread(thr);
return;
}

int eventfilter(void data) {
while (1) {
SDL_WaitEvent(&event);
switch (event.type) {
case SDL_MOUSEBUTTONDOWN:
if (event.button.button==1) bl_dp=TRUE;
if (event.button.button==3) {
SDL_FillRect(screen,NULL,SDL_MapRGB(screen->format,0,0,0));
SDL_UpdateRect(screen,0,0,0,0);
}
break;
case SDL_MOUSEBUTTONUP:
if (event.button.button==1) bl_dp=FALSE;
break;
case SDL_MOUSEMOTION:
if (bl_dp==TRUE) {
rect.x=(event.motion.x)-1;
rect.y=(event.motion.y)-1;
rect.w=10;
rect.h=10;
SDL_FillRect(screen,&rect,SDL_MapRGB(screen->format,r,g,b));
SDL_UpdateRects(screen,1,&rect);
printf(“r:%d, g:%d, b:%d\n”,r,g,b);
}
break;
case SDL_KEYDOWN:
/
if (event.key.keysym.unicode==‘r’) r–;
if (event.key.keysym.unicode==‘R’) r++;
if (event.key.keysym.unicode==‘g’) g–;
if (event.key.keysym.unicode==‘G’) g++;
if (event.key.keysym.unicode==‘b’) b–;
if (event.key.keysym.unicode==‘B’) b++;
printf(“r:%d, g:%d, b:%d\n”,r,g,b); */
if (event.key.keysym.unicode==‘q’||event.key.keysym.unicode==‘Q’)
exit(0);
break;
case SDL_QUIT:
exit(0);
default:
break;
}
}
}

main(int argc, char *argv[]) {
bl_dp=FALSE;
r=g=b=0;

gtk_init(&argc,&argv);

if (SDL_Init(SDL_INIT_VIDEO) < 0) {

fprintf(stderr,“couldn’t initialize SDL: %s\n”,SDL_GetError());
exit(1);
}
atexit(SDL_Quit);

screen=SDL_SetVideoMode(640,480,8,SDL_SWSURFACE|SDL_ANYFORMAT|SDL_FULLSCREEN
);
if (screen==NULL) {
fprintf(stderr,“couldn’t set 640x480x8 video mode:%s\n”,SDL_GetError());
exit(1);
}

SDL_WM_SetCaption("drawer:title","drawer:icon");
SDL_EnableUNICODE(1);

SDL_FillRect(screen, NULL, SDL_MapRGB(screen->format,0,0,0));
SDL_UpdateRect(screen, 0, 0, 0, 0);

thr=SDL_CreateThread(eventfilter,(void *)"data");
if (thr==NULL) {

fprintf(stderr,“can’t create thread:%s\n”,SDL_GetError());
exit(-1);
}
atexit(clearthread);

cd=gtk_color_selection_dialog_new("colorselection");
gtk_widget_hide(GTK_COLOR_SELECTION_DIALOG(cd)->cancel_button);
gtk_widget_hide(GTK_COLOR_SELECTION_DIALOG(cd)->help_button);

gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(cd)->ok_button),“cl
icked”,GTK_SIGNAL_FUNC(exit),NULL);
gtk_signal_connect(GTK_OBJECT(cd),“destroy”,GTK_SIGNAL_FUNC(exit),NULL);

gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(cd)->colorsel),“col
or-changed”,GTK_SIGNAL_FUNC(cb_cc),NULL);
gtk_widget_show(cd);
atexit(gtk_main_quit);

gtk_main();

}

in Linux it works successfully, but W32 it’s thread is does not working.
I compiled follow options:
gcc -o drawer.exe
drawer.c -I/gcc-2.95.2/i386-mingw32/include/SDL -lSDL -lgtk-1.3 -lgdk-1.3 -l
glib-1.3 -mno-cygwin -fnative-struct

What is wrong?