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 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
|
#include <stdlib.h>
#include <gtk/gtk.h>
int main(int argc,char **argv)
{
// ______________Initialisation du GTK+_______________________
gtk_init(&argc,&argv);
// _______________Declaration des Variables___________________
GdkColor color;
color.pixel = 32;
color.red = 55155;
color.green = 60945;
color.blue = 64476;
GtkWidget *pWindow;
GtkWidget *pTablePrimo;
GtkWidget *pTableSecondo;
GtkWidget *pTableTrio;
GtkWidget *pVbox;
GtkWidget *pLogo;
GtkWidget *pImageProjet;
GtkWidget *pImageIntro;
GtkWidget *pLine;
GtkWidget *pLine2;
GtkWidget *pButtonInfoIcon;
GtkWidget *pButtonContinuerIcon;
GtkWidget *pButtonQuitIcon;
GtkWidget *pButtonContinuer;
GtkWidget *pButtonInfo;
GtkWidget *pButtonQuit;
gchar *titre;
// ________ Declarations des fonctions du CallBack __________
void Info(void *pWid,gpointer data);
void quit(GtkWidget *pButton,gpointer data);
void MenuMethode(GtkWidget *pWid,gpointer data);
// ____________Création de la Fenetre principale_____________
pWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_default_size(GTK_WINDOW(pWindow),800,600);
titre = g_locale_to_utf8(" Analyse Numérique - Projet 4 ",-1,NULL,NULL,NULL);
gtk_window_set_title(GTK_WINDOW(pWindow),titre);
gtk_widget_modify_bg (pWindow,GTK_STATE_NORMAL, &color);
gtk_window_set_position(GTK_WINDOW(pWindow),GTK_WIN_POS_CENTER);
g_signal_connect(G_OBJECT(pWindow),"destroy",G_CALLBACK(gtk_main_quit),NULL);
// _____________ Création des interfaces graphiques sur la fenetre principle_____________
pTablePrimo = gtk_table_new(60,80,TRUE);
gtk_container_add(GTK_CONTAINER(pWindow),pTablePrimo);
pTableSecondo = gtk_table_new(54,80,FALSE);
pTableTrio = gtk_table_new(5,80,FALSE);
pLine2 = gtk_hseparator_new();
gtk_table_attach_defaults(GTK_TABLE(pTablePrimo),pTableSecondo,0,80,0,50);
gtk_table_attach_defaults(GTK_TABLE(pTablePrimo),pLine2,2,78,54,55);
gtk_table_attach_defaults(GTK_TABLE(pTablePrimo),pTableTrio,0,80,55,60);
pLogo = gtk_image_new_from_file("./FST_LOGO.png");
gtk_table_attach(GTK_TABLE(pTableSecondo),pLogo,10,70,3,6,GTK_EXPAND,GTK_EXPAND,0,10);
pLine = gtk_hseparator_new();
gtk_table_attach(GTK_TABLE(pTableSecondo),pLine,2,78,6,7,GTK_FILL,GTK_EXPAND,10,10);
pImageProjet = gtk_image_new_from_file("./projet4.png");
gtk_table_attach(GTK_TABLE(pTableSecondo),pImageProjet,33,50,7,12,GTK_EXPAND,GTK_EXPAND,0,10);
pImageIntro = gtk_image_new_from_file("./Intro.png");
gtk_table_attach(GTK_TABLE(pTableSecondo),pImageIntro,20,60,20,50,GTK_EXPAND,GTK_EXPAND,0,0);
pButtonInfo = gtk_button_new();
pButtonContinuer = gtk_button_new();
pButtonQuit = gtk_button_new();
pButtonInfoIcon = gtk_image_new_from_file("./Info.png");
gtk_container_add(GTK_CONTAINER(pButtonInfo),pButtonInfoIcon);
pButtonContinuerIcon = gtk_image_new_from_file("./Continuer.png");
gtk_container_add(GTK_CONTAINER(pButtonContinuer),pButtonContinuerIcon);
pButtonQuitIcon = gtk_image_new_from_file("./Quit.png");
gtk_container_add(GTK_CONTAINER(pButtonQuit),pButtonQuitIcon);
gtk_table_attach(GTK_TABLE(pTableTrio),pButtonInfo,8,20,57,58,GTK_EXPAND,GTK_SHRINK,0,0);
gtk_table_attach(GTK_TABLE(pTableTrio),pButtonContinuer,28,40,57,58,GTK_EXPAND,GTK_SHRINK,0,0);
gtk_table_attach(GTK_TABLE(pTableTrio),pButtonQuit,48,60,57,58,GTK_EXPAND,GTK_SHRINK,0,0);
g_signal_connect(G_OBJECT(pButtonQuit),"clicked",G_CALLBACK(quit),(gpointer *)pWindow);
g_signal_connect(G_OBJECT(pButtonInfo),"clicked",G_CALLBACK(Info),NULL);
g_signal_connect(G_OBJECT(pButtonContinuer),"clicked",G_CALLBACK(MenuMethode),(gpointer *)pTableSecondo);
// ____________________ Fin _________________________
gtk_widget_show_all(pWindow);
gtk_main();
return EXIT_SUCCESS;
} |
Partager