1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| int main (int argc, char **argv)
{
GtkWidget *pSdl;
GtkWidget *pWindow;
GtkWidget *pButton = gtk_button_new_with_label ("test");
GtkWidget *pVbox = gtk_vbox_new (TRUE, 0);
initSDL();
gtk_init (&argc, &argv);
pWindow = gtk_window_new (GTK_WINDOW_TOPLEVEL);
pSdl = gtk_sdl_new (200, 100, 32, SDL_SWSURFACE);
gtk_box_pack_start (GTK_BOX (pVbox), pSdl, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (pVbox), pButton, TRUE, TRUE, 0);
gtk_container_add (GTK_CONTAINER (pWindow), pVbox);
g_signal_connect (G_OBJECT (pButton), "clicked", G_CALLBACK (Clicked),
pSdl);
g_signal_connect (G_OBJECT (pWindow), "destroy",
G_CALLBACK (gtk_main_quit), NULL);
gtk_widget_show_all (pWindow);
gtk_main();
return EXIT_SUCCESS;
} |
Partager