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 30 31 32 33 34 35 36 37 38 39 40
|
#include <stdlib.h>
#include <gtk/gtk.h>
#define composant_1 0
void add_composant(GtkWidget *window, int element)
{
GtkWidget *boutonclose;
switch(element)
{
case composant_1:
boutonclose = gtk_button_new_with_label("Quitter");
break;
}
g_signal_connect(G_OBJECT(boutonclose), "click", G_CALLBACK(gtk_main_quit), NULL);
gtk_container_add(GTK_CONTAINER(window), boutonclose);
}
int main( int argc,
char *argv[] )
{
GtkWidget *window;
gtk_init (&argc, &argv);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
g_signal_connect (G_OBJECT (window), "quit", G_CALLBACK ( gtk_main_quit), NULL);
gtk_window_set_default_size(GTK_WINDOW(window), 700, 600);
gtk_container_set_border_width(GTK_CONTAINER(window), 10);
gtk_window_set_title(GTK_WINDOW(window), "Lecteur Multimedia ");
add_composant(window,composant_1);
gtk_widget_show_all(window);
gtk_main ();
return EXIT_SUCCESS;
} |
Partager