GTK / SDL bis



Here is my problem again:

I'm currently developping a GTK application
and I need using SDL to improve my application.

I saw an example of GTK + SDL program on www.libsdl.org
but this example doesn't help me a lot.

In fact I would like to "include" a little SDL window in a
big GTK window. (by example to be able to play movies in my
GTK application)



I tried to resolve my problem with your advices :) but I
have still problems. here is the part of my program with
problems:


SDL_Thread *thread;
GtkWidget	*drawing_area;
Window	xwin;

gtk_sess *sess = (gtk_sess *)data;

sess->new = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_widget_set_usize(sess->new, 460, 500);
// gtk_widget_show (sess->new);

sess->fixed = gtk_fixed_new();
gtk_widget_ref (sess->fixed);
gtk_widget_show (sess->fixed);
gtk_container_add(GTK_CONTAINER(sess->new), sess->fixed);

drawing_area = gtk_drawing_area_new();
gtk_widget_set_usize(drawing_area, 100, 100);
gtk_fixed_put(GTK_FIXED(sess->fixed), drawing_area, 400,
400);
gtk_widget_realize(drawing_area);
gtk_widget_show(drawing_area);


{ char SDL_windowhack[32];
 sprintf(SDL_windowhack,"SDL_WINDOWID=-543170384",
	 GDK_WINDOW_XWINDOW(drawing_area->window));
 putenv(SDL_windowhack);
}

screen = SDL_SetVideoMode(100, 100, 0, 0);
thread = SDL_CreateThread(play_film, sess);
if (thread == NULL)
 printf("Probleme avec la thread\n");
 // gtk_timeout_add(5, animation, sess);


I do the SDL_Init before this in an init function.

Do you see something wrong in this code ?

Thanks a lot for help

Raph
_________________________________________________________
Le journal des abonnés Caramail - http://www.carazine.com



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