#include <stdio.h>
#include <stdlib.h>
#include <glib.h>
#include <string.h>
#include <gtk/gtk.h>
#define BUFSIZE 880
FILE *fp ,*ftemp;

  GtkWidget *liste;
  GtkWidget *entry1;
  GtkWidget *scrolltexte;
  GtkWidget *texte;
  GtkWidget *scrolllist;

/*icone du programme*/
/* XPM */
static char * apropos_xpm[] = {
"24 36 247 2",
"  	c None",
". 	c #9EF9FD",
"+ 	c #8DFAFC",
"@ 	c #87FBFC",
"# 	c #85F9FB",
"$ 	c #83F7F9",
"% 	c #82F7FB",
"& 	c #83FBFC",
"* 	c #8DFBFC",
"= 	c #97F9FC",
"- 	c #8FF8FC",
"; 	c #85F7FA",
"> 	c #7BF6F9",
", 	c #76F2F6",
"' 	c #72F0F5",
") 	c #6FEFF5",
"! 	c #6CEAF2",
"~ 	c #6AE7EF",
"{ 	c #6BE8F0",
"] 	c #6EEEF4",
"^ 	c #71F1F5",
"/ 	c #74F3F7",
"( 	c #7CF7FA",
"_ 	c #86F8FC",
": 	c #86FBFD",
"< 	c #80F8FC",
"[ 	c #75F2F7",
"} 	c #6FECF2",
"| 	c #6CEAF1",
"1 	c #6AE6EE",
"2 	c #6AE8F0",
"3 	c #6CECF2",
"4 	c #72F2F7",
"5 	c #7BF5FA",
"6 	c #87FBFD",
"7 	c #82F8FB",
"8 	c #79F3F8",
"9 	c #71EEF5",
"0 	c #6BE9F0",
"a 	c #6AE7EE",
"b 	c #6DEDF4",
"c 	c #6FE8F0",
"d 	c #87FBFE",
"e 	c #7DF7FB",
"f 	c #72EFF5",
"g 	c #6DEAF1",
"h 	c #6BE7EF",
"i 	c #6AE6ED",
"j 	c #6AE5ED",
"k 	c #68E1E9",
"l 	c #8EDFE5",
"m 	c #87FAFE",
"n 	c #7EF8FC",
"o 	c #71F0F6",
"p 	c #68E4EB",
"q 	c #63DCE2",
"r 	c #60D1D8",
"s 	c #62D7DE",
"t 	c #67E1E8",
"u 	c #69E5ED",
"v 	c #66E0E7",
"w 	c #67C5CC",
"x 	c #71F1F6",
"y 	c #6BE9F1",
"z 	c #69E5EC",
"A 	c #5ED0D6",
"B 	c #52ACB1",
"C 	c #5CA5AB",
"D 	c #51ACB2",
"E 	c #61D1D7",
"F 	c #67E2E9",
"G 	c #66E0E8",
"H 	c #52B2B7",
"I 	c #94F9FE",
"J 	c #75F4F9",
"K 	c #69E6ED",
"L 	c #65DEE3",
"M 	c #4FABAF",
"N 	c #538F95",
"O 	c #6DD6DD",
"P 	c #65DEE5",
"Q 	c #52B3B9",
"R 	c #7CFAFC",
"S 	c #6EF0F5",
"T 	c #5BC8CE",
"U 	c #69ACB1",
"V 	c #80F0F6",
"W 	c #6CEBF2",
"X 	c #61D5DC",
"Y 	c #65CBD2",
"Z 	c #6AEAF0",
"` 	c #62D8DE",
" .	c #5AB4B9",
"..	c #7AF5FA",
"+.	c #6DEBF2",
"@.	c #67E1E9",
"#.	c #55B9C0",
"$.	c #82D3DC",
"%.	c #64D6DD",
"&.	c #69E4EC",
"*.	c #64DBE2",
"=.	c #59C0C7",
"-.	c #5AA3A8",
";.	c #73F2F7",
">.	c #6CE9F0",
",.	c #68E2E9",
"'.	c #60CFD6",
").	c #5EADB3",
"!.	c #6FCFD5",
"~.	c #62C9D0",
"{.	c #5ECBD3",
"].	c #5CC8D0",
"^.	c #55B6BD",
"/.	c #50A3A9",
"(.	c #55989E",
"_.	c #79F4F8",
":.	c #6DECF2",
"<.	c #67DFE7",
"[.	c #5ECAD1",
"}.	c #59B0B6",
"|.	c #71B0B5",
"1.	c #67B2B8",
"2.	c #5DA4AB",
"3.	c #5CA0A7",
"4.	c #569BA2",
"5.	c #96F8FE",
"6.	c #6EECF3",
"7.	c #5DC8CE",
"8.	c #57A6AC",
"9.	c #5F9FA5",
"0.	c #7AACB5",
"a.	c #7AAAB2",
"b.	c #87FAFD",
"c.	c #72F1F6",
"d.	c #62D5DC",
"e.	c #58BCC3",
"f.	c #59A5AA",
"g.	c #639EA3",
"h.	c #81FCFD",
"i.	c #74F3F8",
"j.	c #65DDE3",
"k.	c #5DCCD2",
"l.	c #57B8BF",
"m.	c #55A2A8",
"n.	c #54949B",
"o.	c #659BA2",
"p.	c #8AFBFE",
"q.	c #79F6F9",
"r.	c #6CE9F1",
"s.	c #61D5DB",
"t.	c #57B8BE",
"u.	c #418C90",
"v.	c #538C92",
"w.	c #70A0A7",
"x.	c #A2FAFE",
"y.	c #88FAFD",
"z.	c #71EFF5",
"A.	c #66DDE5",
"B.	c #5CC6CD",
"C.	c #4DA6AB",
"D.	c #589BA1",
"E.	c #8BF9FE",
"F.	c #7BF6FA",
"G.	c #6CEAF0",
"H.	c #69E4EB",
"I.	c #62D1D7",
"J.	c #59ADB2",
"K.	c #96F5FC",
"L.	c #85F6FC",
"M.	c #71F0F7",
"N.	c #68E3EB",
"O.	c #69D7DD",
"P.	c #6FCED3",
"Q.	c #7DEDF6",
"R.	c #76EDF5",
"S.	c #67DAE0",
"T.	c #73CED4",
"U.	c #80E6EE",
"V.	c #73E1E9",
"W.	c #67DDE4",
"X.	c #67E0E8",
"Y.	c #62D6DD",
"Z.	c #59C0C6",
"`.	c #63B7BD",
" +	c #7AD3DB",
".+	c #5BB8BE",
"++	c #53B2B8",
"@+	c #50AAB0",
"#+	c #53A4AA",
"$+	c #519BA1",
"%+	c #3C7B80",
"&+	c #326D71",
"*+	c #356D71",
"=+	c #50878D",
"-+	c #8AF9FC",
";+	c #8BF5FB",
">+	c #88F4FA",
",+	c #8AF6FB",
"'+	c #88FCFE",
")+	c #7CF9FB",
"!+	c #77F2F7",
"~+	c #75EDF4",
"{+	c #73EDF3",
"]+	c #74EFF5",
"^+	c #76F4F9",
"/+	c #80F9FD",
"(+	c #97F9FE",
"_+	c #7DF6FB",
":+	c #70EFF5",
"<+	c #6BE8EF",
"[+	c #73EFF6",
"}+	c #7CECF4",
"|+	c #80F7FB",
"1+	c #6FEDF3",
"2+	c #69E1E9",
"3+	c #71F3F7",
"4+	c #79DBE3",
"5+	c #6DEEF4",
"6+	c #68CED6",
"7+	c #64DCE3",
"8+	c #64C7CE",
"9+	c #69DFE6",
"0+	c #5DCDD4",
"a+	c #66BDC4",
"b+	c #68D3DA",
"c+	c #66DEE5",
"d+	c #56B4BA",
"e+	c #60ADB3",
"f+	c #68C6CC",
"g+	c #63CDD3",
"h+	c #65DCE3",
"i+	c #63D9DF",
"j+	c #55BAC0",
"k+	c #4E9BA0",
"l+	c #55B0B5",
"m+	c #51B0B6",
"n+	c #57BEC5",
"o+	c #5DCCD3",
"p+	c #56BBC1",
"q+	c #4CA0A5",
"r+	c #499298",
"s+	c #4A8E93",
"t+	c #69AAB1",
"u+	c #46878D",
"v+	c #3C7A80",
"w+	c #6EAAB0",
"x+	c #84B9BD",
"                    . + @ # $ % & * =           ",
"              - ; > , ' ) ! ~ { ] ^ / ( _       ",
"          : < [ } | ~ 1 1 1 1 1 1 1 2 3 4 5     ",
"      6 7 8 9 0 1 1 1 1 1 1 1 1 1 1 1 a 0 b c   ",
"    d e f g h 1 i j 1 1 1 1 1 1 1 1 1 1 1 ~ k l ",
"  m n o { 1 1 p q r s t u 1 1 1 1 1 1 1 1 1 v w ",
"  < x y 1 1 z A B C D E F 1 1 1 1 1 1 1 1 1 G H ",
"I J y 1 1 K L M N     O F 1 1 1 1 1 1 1 1 1 P Q ",
"R S 1 1 1 p T U       V W ~ 1 1 1 1 1 1 1 1 X Y ",
"Z y 1 1 z `  .        ..+.1 1 1 1 1 1 1 1 @.#.$.",
"%.@.u &.*.=.-.      & ;.>.1 1 1 1 1 1 1 ,.'.).  ",
"!.~.{.].^./.(.      _.:.~ 1 1 1 1 1 i <.[.}.|.  ",
"  1.2.3.4.      5.( 6.~ 1 1 1 1 1 1 t 7.8.9.    ",
"    0.a.        b.c.~ 1 1 1 1 i F d.e.f.g.      ",
"              h.i.y 1 1 1 u j.k.l.m.n.o.        ",
"            p.q.r.1 1 u F s.t.u.v.w.            ",
"          x.y.z.1 1 j A.B.C.D.                  ",
"          E.F.G.1 1 H.I.J.                      ",
"        K.L.M.2 1 1 N.O.P.                      ",
"        Q.R.r.1 1 1 &.S.T.                      ",
"        U.V.W.,.H.X.Y.Z.`.                      ",
"           +.+++H @+#+$+                        ",
"              %+&+*+=+                          ",
"                                                ",
"            -+;+>+,+                            ",
"        '+)+!+~+{+]+^+/+                        ",
"      (+_+:+>.h a <+:.[+}+                      ",
"      |+1+~ 1 1 1 1 1 1 2+                      ",
"      3+0 1 1 1 1 1 1 1 k 4+                    ",
"      5+~ 1 1 1 1 1 1 1 G 6+                    ",
"      K 1 1 1 1 1 1 1 u 7+8+                    ",
"      9+&.1 1 1 1 1 1 F 0+a+                    ",
"      b+c+u 1 1 1 1 z Y.d+e+                    ",
"      f+g+h+&.1 1 p i+j+k+                      ",
"        l+m+n+o+o+p+q+r+s+                      ",
"            t+u+v+w+x+                          "};


/* XPM */
static char * imprime_xpm[] = {
"40 36 440 2",
"  	c None",
". 	c #FFFFFF",
"+ 	c #F8F8F8",
"@ 	c #707070",
"# 	c #D7D7D7",
"$ 	c #A3A3A3",
"% 	c #FDFDFD",
"& 	c #F4F4F4",
"* 	c #F0F0F0",
"= 	c #8D8D8D",
"- 	c #E4E4E4",
"; 	c #A8A8A8",
"> 	c #D8D8D8",
", 	c #DFDFDF",
"' 	c #323232",
") 	c #656565",
"! 	c #464646",
"~ 	c #454545",
"{ 	c #898989",
"] 	c #E6E6E6",
"^ 	c #FCFCFC",
"/ 	c #E0E0E0",
"( 	c #C4C4C4",
"_ 	c #0C0C0C",
": 	c #606060",
"< 	c #000000",
"[ 	c #767676",
"} 	c #B4B4B4",
"| 	c #7E7E7E",
"1 	c #242424",
"2 	c #212121",
"3 	c #969696",
"4 	c #F1F1F1",
"5 	c #131313",
"6 	c #333333",
"7 	c #919191",
"8 	c #555555",
"9 	c #AAAAAA",
"0 	c #AEAEAE",
"a 	c #696969",
"b 	c #5A5A5A",
"c 	c #303030",
"d 	c #595959",
"e 	c #787878",
"f 	c #101010",
"g 	c #BFC0C1",
"h 	c #D3D4D6",
"i 	c #EFEFEF",
"j 	c #FBFBFB",
"k 	c #E5E5E5",
"l 	c #808080",
"m 	c #8F8F8F",
"n 	c #2E2E2E",
"o 	c #B0B0B0",
"p 	c #0A0A0A",
"q 	c #748092",
"r 	c #8795AA",
"s 	c #ADB6C2",
"t 	c #BFC2C6",
"u 	c #E5E5E6",
"v 	c #ECECEC",
"w 	c #6F6F6F",
"x 	c #BCBCBC",
"y 	c #AFAFAF",
"z 	c #070707",
"A 	c #8491A6",
"B 	c #8F9BAE",
"C 	c #B3BAC5",
"D 	c #CACCCE",
"E 	c #EBEBEB",
"F 	c #9C9C9C",
"G 	c #828282",
"H 	c #252525",
"I 	c #030304",
"J 	c #191C21",
"K 	c #ACAEB0",
"L 	c #C1C2B2",
"M 	c #8D9086",
"N 	c #7B848D",
"O 	c #929DAE",
"P 	c #C1C5CB",
"Q 	c #D5D6D7",
"R 	c #EDEDED",
"S 	c #1F1F1F",
"T 	c #505050",
"U 	c #2D2D2D",
"V 	c #BABAB0",
"W 	c #F2F2ED",
"X 	c #E5E5DC",
"Y 	c #98977F",
"Z 	c #C0C0AF",
"` 	c #B4B69F",
" .	c #7E827B",
"..	c #686E76",
"+.	c #939CAA",
"@.	c #BDC0C5",
"#.	c #DBDCDC",
"$.	c #EAEAEA",
"%.	c #C7C7C7",
"&.	c #777777",
"*.	c #393939",
"=.	c #232323",
"-.	c #202020",
";.	c #111111",
">.	c #B6B5A0",
",.	c #969684",
"'.	c #ABAA8E",
").	c #757454",
"!.	c #87876B",
"~.	c #EDEDE6",
"{.	c #E8E8E0",
"].	c #D0D0C0",
"^.	c #B3B398",
"/.	c #A7A794",
"(.	c #66686B",
"_.	c #636971",
":.	c #97A2B2",
"<.	c #AFB7C3",
"[.	c #D4D7DC",
"}.	c #F2F2F2",
"|.	c #191919",
"1.	c #0B0B0B",
"2.	c #0F0F0F",
"3.	c #EBEBE8",
"4.	c #FBFBFA",
"5.	c #E0E0D6",
"6.	c #656550",
"7.	c #2C2C24",
"8.	c #5B5A45",
"9.	c #A9A885",
"0.	c #C0C0B1",
"a.	c #797957",
"b.	c #EFEFEB",
"c.	c #E7E7DE",
"d.	c #DFDFD3",
"e.	c #C3C3B6",
"f.	c #8D8D86",
"g.	c #4B4C4F",
"h.	c #4F5257",
"i.	c #7F8A9A",
"j.	c #656E80",
"k.	c #6A6E74",
"l.	c #6F7174",
"m.	c #1D1E1F",
"n.	c #848465",
"o.	c #DEDDD1",
"p.	c #ECECE5",
"q.	c #ABAB8F",
"r.	c #616049",
"s.	c #F3F3F0",
"t.	c #C2C2AE",
"u.	c #585849",
"v.	c #111110",
"w.	c #303022",
"x.	c #9B9A7C",
"y.	c #D1D1C2",
"z.	c #9A9A84",
"A.	c #CECEBE",
"B.	c #E6E6DC",
"C.	c #E3E3DA",
"D.	c #97978E",
"E.	c #4E4E4E",
"F.	c #313233",
"G.	c #585C62",
"H.	c #8893A4",
"I.	c #7E8EA3",
"J.	c #414750",
"K.	c #30353B",
"L.	c #1D2224",
"M.	c #101315",
"N.	c #1B1F21",
"O.	c #ECECEB",
"P.	c #D7D7CF",
"Q.	c #86866A",
"R.	c #71714F",
"S.	c #323123",
"T.	c #E8E8E2",
"U.	c #DFDFD1",
"V.	c #666555",
"W.	c #CDCCBB",
"X.	c #A0A07E",
"Y.	c #3E3D31",
"Z.	c #0B0B09",
"`.	c #3A3A29",
" +	c #AEAE98",
".+	c #E0E0D3",
"++	c #9A997D",
"@+	c #ABAB92",
"#+	c #E3E3DB",
"$+	c #DDDDDA",
"%+	c #5D646E",
"&+	c #5B636E",
"*+	c #34393F",
"=+	c #212528",
"-+	c #111416",
";+	c #101313",
">+	c #1B1E20",
",+	c #CCCCB9",
"'+	c #F9F9F8",
")+	c #F2F2EF",
"!+	c #E5E5DE",
"~+	c #454535",
"{+	c #7D7C60",
"]+	c #818161",
"^+	c #979674",
"/+	c #494934",
"(+	c #B4B39C",
"_+	c #F0F0ED",
":+	c #E6E6DF",
"<+	c #919181",
"[+	c #A7A686",
"}+	c #63634F",
"|+	c #43433E",
"1+	c #181812",
"2+	c #4A4A3C",
"3+	c #BEBDAD",
"4+	c #E1E1D6",
"5+	c #DBDBCF",
"6+	c #A6A68E",
"7+	c #1F1F1D",
"8+	c #282829",
"9+	c #748195",
"0+	c #363D45",
"a+	c #252A2E",
"b+	c #131618",
"c+	c #15191B",
"d+	c #818FA1",
"e+	c #545659",
"f+	c #505045",
"g+	c #A6A68B",
"h+	c #848463",
"i+	c #C8C8B5",
"j+	c #EFEFE9",
"k+	c #B3B296",
"l+	c #383828",
"m+	c #454533",
"n+	c #5E5E4C",
"o+	c #7C7C62",
"p+	c #80805E",
"q+	c #A1A082",
"r+	c #EDEDE9",
"s+	c #E8E8E4",
"t+	c #8B8B6E",
"u+	c #4B4B37",
"v+	c #515145",
"w+	c #4D4D3C",
"x+	c #6D6D5F",
"y+	c #7A796B",
"z+	c #27271D",
"A+	c #171711",
"B+	c #55574F",
"C+	c #8393A6",
"D+	c #464C55",
"E+	c #2C3137",
"F+	c #15191C",
"G+	c #15181A",
"H+	c #A3B0C0",
"I+	c #78808C",
"J+	c #323334",
"K+	c #35352E",
"L+	c #979673",
"M+	c #D9D9CB",
"N+	c #A2A283",
"O+	c #9B9B7C",
"P+	c #C3C3B4",
"Q+	c #7C7C5B",
"R+	c #25251D",
"S+	c #29291E",
"T+	c #81816C",
"U+	c #B6B69E",
"V+	c #AEAD91",
"W+	c #5E5E56",
"X+	c #E4E3DC",
"Y+	c #E2E2DB",
"Z+	c #BAB9A3",
"`+	c #545444",
" @	c #202017",
".@	c #0C0C0B",
"+@	c #454648",
"@@	c #5B6472",
"#@	c #31363C",
"$@	c #1A1E21",
"%@	c #171B1E",
"&@	c #8F9DAF",
"*@	c #CFDCE2",
"=@	c #B8C7D3",
"-@	c #899AAE",
";@	c #727A86",
">@	c #343536",
",@	c #31312E",
"'@	c #4B4B3B",
")@	c #C3C3AD",
"!@	c #BEBEAA",
"~@	c #888879",
"{@	c #B2B295",
"]@	c #59594E",
"^@	c #2B2B20",
"/@	c #13130E",
"(@	c #737360",
"_@	c #D3D3C7",
":@	c #E3E3E0",
"<@	c #BBBBA4",
"[@	c #535349",
"}@	c #161611",
"|@	c #363730",
"1@	c #727F93",
"2@	c #1F2428",
"3@	c #161A1D",
"4@	c #1B2021",
"5@	c #5E6777",
"6@	c #B7C5D2",
"7@	c #E1EBEE",
"8@	c #CAD6DF",
"9@	c #A6B5C5",
"0@	c #919EB2",
"a@	c #747C88",
"b@	c #38393A",
"c@	c #30302F",
"d@	c #4C4C3B",
"e@	c #727256",
"f@	c #E3E2DA",
"g@	c #EBEBE6",
"h@	c #D9D8CF",
"i@	c #68684F",
"j@	c #5D5C48",
"k@	c #515042",
"l@	c #5B5B4B",
"m@	c #7A7A61",
"n@	c #646349",
"o@	c #21211C",
"p@	c #1E1E1A",
"q@	c #454B54",
"r@	c #262A2F",
"s@	c #1A1C20",
"t@	c #535B66",
"u@	c #6B7588",
"v@	c #C1CEDA",
"w@	c #E2EDEF",
"x@	c #8997AC",
"y@	c #777F8B",
"z@	c #2E2F30",
"A@	c #252524",
"B@	c #515141",
"C@	c #9C9C7F",
"D@	c #95957B",
"E@	c #979677",
"F@	c #E4E4DE",
"G@	c #9B9B7B",
"H@	c #363629",
"I@	c #161613",
"J@	c #191917",
"K@	c #818C9B",
"L@	c #8595A8",
"M@	c #565E69",
"N@	c #282D31",
"O@	c #21252A",
"P@	c #434A52",
"Q@	c #5D6674",
"R@	c #9AA8BB",
"S@	c #D3DFE6",
"T@	c #A3B2C2",
"U@	c #7A828F",
"V@	c #171716",
"W@	c #23221A",
"X@	c #858568",
"Y@	c #B1B19A",
"Z@	c #C2C1AC",
"`@	c #989773",
" #	c #34342F",
".#	c #131310",
"+#	c #7B8595",
"@#	c #606979",
"##	c #2B3036",
"$#	c #121517",
"%#	c #202328",
"&#	c #424855",
"*#	c #3A4047",
"=#	c #464E59",
"-#	c #5F6776",
";#	c #96A4B7",
">#	c #CCDAE1",
",#	c #DEE9ED",
"'#	c #D9E4EA",
")#	c #C7D3DE",
"!#	c #ADB9C8",
"~#	c #92A0B3",
"{#	c #8A99AD",
"]#	c #7C8491",
"^#	c #414346",
"/#	c #444335",
"(#	c #303027",
"_#	c #161612",
":#	c #798392",
"<#	c #2E3339",
"[#	c #202327",
"}#	c #30363F",
"|#	c #3D424B",
"1#	c #393E46",
"2#	c #C2D0DB",
"3#	c #D9E5EA",
"4#	c #D7E3E8",
"5#	c #B3C1D0",
"6#	c #97A6B8",
"7#	c #95A1B1",
"8#	c #64696F",
"9#	c #1B1B1C",
"0#	c #798393",
"a#	c #7C8B9F",
"b#	c #545C67",
"c#	c #111516",
"d#	c #3E444C",
"e#	c #3B4148",
"f#	c #99A9BA",
"g#	c #B9C7D4",
"h#	c #B4C2D1",
"i#	c #9CABBD",
"j#	c #8C9CAF",
"k#	c #768397",
"l#	c #21262A",
"m#	c #202529",
"n#	c #16191D",
"o#	c #3B4149",
"p#	c #3F464E",
"q#	c #687183",
"r#	c #505863",
"s#	c #3C434B",
"t#	c #24292D",
"u#	c #1E2325",
"v#	c #1A1E20",
"w#	c #181A1E",
"x#	c #23282E",
"y#	c #131619",
"z#	c #131518",
"A#	c #2D3139",
"B#	c #383D44",
"C#	c #33373E",
"D#	c #2F3339",
"E#	c #191C1E",
"F#	c #1A1D21",
"G#	c #16181B",
"                                                                                ",
"                                                                                ",
"                                                                                ",
"                                                                                ",
"                                    . . .                                       ",
"                                  . + . . . . . . . .                           ",
"                                . . @ # $ + . . . . . . . . . .                 ",
"                              % & * . + = - . ; > . . . . . . , ' )             ",
"                              . > ! ~ { ] ^ . / ( . . . . . / _ :               ",
"                    < < < < [ . . + } | 1 2 3 . & 4 . . . ^ 5 6                 ",
"                    + / 7 8 9 0 6 a . . . ^ & . b c d * . e f                   ",
"                      g h i j k l m l n f . . . . . . > o p                     ",
"                      q r r s t u . . v m * w ! x . . . y z                     ",
"                      A r r r r r B C D E . . / F } G . c H < < < I J <         ",
"                    K L M N r r r r r r r O P Q R * . . S T 2 < < < < < U       ",
"                  V W X Y Z `  ...r r r r r r r r +.@.#.6 $., %.&.*.=.-.z ;.    ",
"                >.,.'.).!.~.{.].^./.(._.r r r r r r r r :.<.[.}.4 $ |.1.2.      ",
"              3.4.5.6.7.8.9.0.a.b.c.d.e.f.g.h.i.r r r r r r r j.k.l.H m.        ",
"            n.o.p.q.r.s.t.u.v.w.x.y.z.A.B.C.D.E.F.G.H.r r r I.J.K.L.M.N.        ",
"          O.P.Q.R.S.B.T.U.V.W.X.Y.Z.`. +.+++@+#+$+3 ' %+r r &+*+=+-+;+>+<       ",
"        ,+'+)+!+~+{+]+^+/+(+_+:+<+[+}+|+1+2+3+4+5+6+7+8+r 9+0+a+b+;+;+c+<       ",
"      d+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+y+z+A+B+C+D+E+F+;+;+;+G+<       ",
"      H+r I+J+K+L+M+N+O+P+Q+R+S+T+U+V+W+X+Y+Z+`+ @.@+@r @@#@$@;+;+;+b+%@<       ",
"    &@*@=@-@r ;@>@,@'@)@~.!@~@{@]@^@/@(@_@:@<@[@}@|@r 1@0+2@-+;+;+-+3@4@<       ",
"    5@6@7@8@9@0@r a@b@c@d@e@f@g@h@i@j@k@l@m@n@o@p@r C+q@r@b+;+;+M.F+%@s@<       ",
"    t@u@v@w@7@8@H+x@r y@z@A@B@C@D@E@:+F@G@H@I@J@K@L@M@N@F+;+;+;+G+%@O@< <       ",
"      P@Q@R@S@w@7@8@T@x@r U@J+V@W@X@Y@Z@`@ #.#+#r @###3@M.;+;+$#%@%#< < <       ",
"      &#*#=#-#;#>#,#'#)#!#~#{#]#^#A@z+/#(#_#:#L@5@<#L.M.;+;+-+3@[#< < <         ",
"        }#|#1#P@@@{#2#3#4#8@5#T@6#7#8#V@9#0#a#b#<#2@c#;+;+-+3@[#< < <           ",
"            d#0+0+e#P@j.f#=@g#h#i#R@j#C+k#-#J.N@l#c#;+;+-+3@m#< < <             ",
"              n#e#o#0+0+0+0+p#Q@q#Q@r#D+s#E+t#u#-+;+;+-+v#w#< < <               ",
"                  < x#1#o#0+0+0+0+0+0+<#a+t#$@-+;+;+y#%#< < < <                 ",
"                      < < z#A#B#C#D#a+t#t#3@;+E#F#G#< < < < <                   ",
"                          < < < < < < < < < < < < < < < <                       ",
"                                    < < < < < < < <                             ",
"                                                                                "};


/* XPM */
static char * sortie_xpm[] = {
"32 32 154 2",
"  	c None",
". 	c #FFFFFF",
"+ 	c #5D757A",
"@ 	c #2F4F4F",
"# 	c #E2E2F5",
"$ 	c #DADAE9",
"% 	c #5A7276",
"& 	c #DBDBEA",
"* 	c #969F9F",
"= 	c #738383",
"- 	c #889597",
"; 	c #C7C7CD",
"> 	c #536B6B",
", 	c #839090",
"' 	c #9CA3A3",
") 	c #ACB2B7",
"! 	c #D1D1DC",
"~ 	c #9DA4A4",
"{ 	c #BEBEBE",
"] 	c #BCBCBC",
"^ 	c #B6B6B6",
"/ 	c #B9B9B9",
"( 	c #C6C6CB",
"_ 	c #ABABAB",
": 	c #0B0D0E",
"< 	c #202429",
"[ 	c #020202",
"} 	c #003B3B",
"| 	c #555555",
"1 	c #272D33",
"2 	c #708090",
"3 	c #454F59",
"4 	c #038686",
"5 	c #00CDCD",
"6 	c #41454A",
"7 	c #B0B3B5",
"8 	c #49545E",
"9 	c #069293",
"0 	c #00FAFA",
"a 	c #1D8160",
"b 	c #323941",
"c 	c #A6ABAF",
"d 	c #B5B5B5",
"e 	c #B0B0B0",
"f 	c #566672",
"g 	c #007373",
"h 	c #02F8F6",
"i 	c #2B9160",
"j 	c #257046",
"k 	c #4F4F4F",
"l 	c #0C2517",
"m 	c #737373",
"n 	c #4E5965",
"o 	c #006D6D",
"p 	c #06EEE7",
"q 	c #23A37A",
"r 	c #2E8B57",
"s 	c #0FAC99",
"t 	c #17482D",
"u 	c #048A8B",
"v 	c #04F2EE",
"w 	c #22A67F",
"x 	c #00D5D5",
"y 	c #09DFD4",
"z 	c #1E5137",
"A 	c #4A5560",
"B 	c #00E6E6",
"C 	c #07EBE3",
"D 	c #AAAAAA",
"E 	c #474747",
"F 	c #00FFFF",
"G 	c #0ED8C7",
"H 	c #12412C",
"I 	c #586571",
"J 	c #767878",
"K 	c #005A5A",
"L 	c #00E3E3",
"M 	c #12D0BB",
"N 	c #11412D",
"O 	c #4C5762",
"P 	c #000808",
"Q 	c #0FD6C5",
"R 	c #1D5034",
"S 	c #22A67D",
"T 	c #28794B",
"U 	c #2B3137",
"V 	c #181B19",
"W 	c #27784A",
"X 	c #06E8E1",
"Y 	c #1EB18E",
"Z 	c #277A4C",
"` 	c #1A1E22",
" .	c #2A8251",
"..	c #2C8855",
"+.	c #494949",
"@.	c #1E1E1E",
"#.	c #01F9F7",
"$.	c #1BB798",
"%.	c #226941",
"&.	c #283537",
"*.	c #04E2DD",
"=.	c #2E4F3D",
"-.	c #171717",
";.	c #2B8251",
">.	c #1EAF8B",
",.	c #226A42",
"'.	c #314544",
").	c #6A7988",
"!.	c #393E42",
"~.	c #2C3033",
"{.	c #227D55",
"].	c #297E4E",
"^.	c #263133",
"/.	c #6A7A89",
"(.	c #1B4D32",
"_.	c #030304",
":.	c #1F613C",
"<.	c #1B1B1B",
"[.	c #424242",
"}.	c #999999",
"|.	c #B3B3B3",
"1.	c #0C0E10",
"2.	c #23282E",
"3.	c #3E3E3E",
"4.	c #728191",
"5.	c #BABBBB",
"6.	c #262D2D",
"7.	c #242424",
"8.	c #5A5A5A",
"9.	c #434343",
"0.	c #215E3D",
"a.	c #1C1E1F",
"b.	c #4F4F54",
"c.	c #194F31",
"d.	c #444B53",
"e.	c #A5AAAE",
"f.	c #16472C",
"g.	c #7E7F7F",
"h.	c #AAAEB2",
"i.	c #1A5133",
"j.	c #7C7D7C",
"k.	c #00B2B2",
"l.	c #06ABAB",
"m.	c #676767",
"n.	c #A0A8AE",
"o.	c #BFC3CD",
"p.	c #D0D0DA",
"q.	c #91919B",
"r.	c #6E6E78",
"s.	c #7E7E87",
"t.	c #D5D5E1",
"u.	c #586F72",
"v.	c #5D747A",
"w.	c #375555",
". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . + @ ",
". # $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ % @ ",
". & * = = = = = = = = = = = = = = = = = = = = = = = = = - ; > @ ",
". & = , ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ) ! > @ ",
". & = ~ { { { { { { { { ] ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ / { { ( ! > @ ",
". & = ~ { { { { { { { { _ : < < < < < < < < < [ } | { { ( ! > @ ",
". & = ~ { { { { { { { { _ 1 2 2 2 2 2 2 2 2 3 4 5 6 7 { ( ! > @ ",
". & = ~ { { { { { { { { _ 1 2 2 2 2 2 2 2 8 9 0 a b c { ( ! > @ ",
". & = ~ { { { { { { d e _ 1 2 2 2 2 2 2 f g h i j b c { ( ! > @ ",
". & = ~ { { { { { { k l m 1 2 2 2 2 2 n o p q r j b c { ( ! > @ ",
". & = ~ { { { { { { k s t 1 2 2 2 2 3 u v w r r j b c { ( ! > @ ",
". & = ~ { { { { { { k x y z A 2 2 2 1 B C r r r j b c { ( ! > @ ",
". & = ~ ] D D D D D E x F G H I 2 2 1 B C r r r j b c { ( ! > @ ",
". & = ~ J K K K K K K L F F M N O 2 1 B C r r r j b c { ( ! > @ ",
". & = ~ P F F F F F F F F F F Q R 3 1 B C r r r j b c { ( ! > @ ",
". & = ~ P F F F F F F F F F F S T U 1 B C r r r j b c { ( ! > @ ",
". & = ~ V W W W W W W X F h Y Z ` 2 1 B C  .W ..j b c { ( ! > @ ",
". & = ~ / +.+.+.+.+.@.x #.$.%.&.2 2 1 B *.=.-.;.j b c { ( ! > @ ",
". & = ~ { { { { { { k x >.,.'.).2 2 1 B x !.~.;.j b c { ( ! > @ ",
". & = ~ { { { { { { k {.].^./.2 2 2 1 B X (._.;.j b c { ( ! > @ ",
". & = ~ { { { { { { k :.<.1 2 2 2 2 1 B C r r r j b c { ( ! > @ ",
". & = ~ { { { { { { k [._ 1 2 2 2 2 1 B C r r r j b c { ( ! > @ ",
". & = ~ { { { { { { }.|._ 1.2.2.2.2.1.B C r r r j b c { ( ! > @ ",
". & = ~ { { { { { { { { _ 3.e e e e 3.B C r r r j b 4.5.( ! > @ ",
". & = 6.7.7.7.7.7.7.7.7.7.8.{ { { { 9.B C r r r 0.a.7.7.b.! > @ ",
". & = ~ { { { { { { { { { { { { { { 9.B C r r c.d.e.{ { ( ! > @ ",
". & = ~ { { { { { { { { { { { { { { 9.B C r f.g.h.{ { { ( ! > @ ",
". & = ~ { { { { { { { { { { { { { { 9.B C i.j.] { { { { ( ! > @ ",
". & = ~ { { { { { { { { { { { { { { 9.k.l.m.{ { { { { { ( ! > @ ",
". & n.o.p.p.p.p.p.p.p.p.p.p.p.p.p.p.q.r.s.p.p.p.p.p.p.p.t.! > @ ",
". % u.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.v.u.w.@ ",
"@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ "};


/* XPM */
static char * note_xpm[] = {
"32 32 12 1",
" 	c None",
".	c #FFFFFF",
"+	c #808080",
"@	c #FFFF00",
"#	c #C0C0C0",
"$	c #000080",
"%	c #000000",
"&	c #800000",
"*	c #808000",
"=	c #0000FF",
"-	c #008080",
";	c #00FFFF",
"                                ",
"                                ",
"                                ",
"                 .              ",
"                ...+            ",
"               .@.#.+           ",
"              .....#.#+         ",
"      #+$$   .....@.###++%      ",
"      +.&*&$$......#.####+%     ",
"       +.**&$#..@.@.#.####+%    ",
"       +@&**&%...#.#.#.####+%   ",
"      #+@.@&*&$$@.@.#.#######%  ",
"    ##.*@@.*&*%+#..#.#.#######+ ",
"   #@.@*+*@.%=%%+#@.#.######.+%%",
"  ........+.=%%%%+##.#.####.+%% ",
"  @.......@+#-%%%%+##.#.##.+%%+ ",
"  .........%---%%%%+#..##.+%+   ",
"  =.@.......@+;-%%%%+#.#.+%+    ",
"   =..........+.-%%%%+#.+%+     ",
"    =.@.@.@.@.@+#-%%%%++++      ",
"     $..........+#-%%%%++       ",
"      $.@.@.@.@@@+#-%%%%++      ",
"        ..........+#-%%%%+%     ",
"        %.@.@.@.@#.+#%#%$$#%    ",
"        +%......#.% +#-=-%%#%+  ",
"          %.@.@#.%   +=#%-%%#%+ ",
"           %#.#.%  +  %+.%-%%#%+",
"            %#.%  +    %+;%-%%%+",
"             +%  +      %+-%-%%%",
"                +        %+-%-%%",
"               +          %+-%%%",
"              +            %%%% "};


/*la structure pour le tableau du fichier index*/
struct recette
{
  int numero;
  char libelle[60];
  int rdebut;
  int rfin;
};

 struct recette *plist=NULL;
 struct recette *backup;

int vdebut,vfin;

/*affiche les renseignements sur Gfaim*/
void apropos()
{
char *renseigne;

renseigne="\n\n\n                    Gfaim v0.3\n\nlogiciel de recherche pour la base de recettes d'Alexandre PUKALL\nGfaim est sous licence GPL mais la base de recettes d'alexandre PUKALL est en freeware elle ne doit pas servir pour un logiciel commercial";
/*bloque l'affichage du texte*/
     gtk_text_freeze(GTK_TEXT(texte));

/*pointe vers le debut du texte*/
     gtk_text_set_point(GTK_TEXT(texte),0);

/*efface tous*/
     gtk_text_forward_delete(GTK_TEXT(texte),gtk_text_get_length(GTK_TEXT(texte)));

/*copie la ligne dans la zone d'affichage*/
      gtk_text_insert(GTK_TEXT(texte),NULL,NULL,NULL,renseigne,strlen(renseigne));

/*replace au debut de la recette*/
    gtk_text_set_point(GTK_TEXT(texte),0);

/*libere l'affichage du texte*/
    gtk_text_thaw(GTK_TEXT(texte));     
}

/*charge la recette d'aprés les indications binaire debut et fin*/
void charge_recette(int debut,int fin)
{   

/*buffer pour la lecture d'une ligne de recette*/
    char buf[BUFSIZE];

/*positionnement au debut du fichier*/    
     fseek(fp,0,0);

/*bloque l'affichage du texte*/
     gtk_text_freeze(GTK_TEXT(texte));

/*pointe vers le debut du texte*/
     gtk_text_set_point(GTK_TEXT(texte),0);

/*efface tous*/
     gtk_text_forward_delete(GTK_TEXT(texte),gtk_text_get_length(GTK_TEXT(texte)));    

/*placement au debut du fichier*/
     fseek(fp,debut,0);

/*lecture de la recette*/
     while (ftell(fp) < fin)
     {
      fgets(buf,BUFSIZE,fp);

/*copie la ligne dans la zone d'affichage*/
      gtk_text_insert(GTK_TEXT(texte),NULL,NULL,NULL,buf,strlen(buf));
     }

/*replace au debut de la recette*/
    gtk_text_set_point(GTK_TEXT(texte),0);

/*libere l'affichage du texte*/
    gtk_text_thaw(GTK_TEXT(texte));

}


/* charge le fichier index dans un tableau */
void lit_index()
{

/*buffer de la liste de recette*/
     char buffer[61];
     int i=0;
     int k=0;
     char buf[BUFSIZE];

/*champs pour la decoupe de la ligne du fichier index*/
     gchar **champs;

/*sauvegarde du pointeur*/
     backup = plist;

/*ouverture du fichier index*/
     if ((fp=fopen(DATADIR"/cuisine.idx","r"))==NULL)
     {
      fprintf(stderr,"erreur a l'ouverture du fichier cuisine.idx.\n");
      exit(1);
     }

/*lecture des 10510 lignes*/
     while (k<10510)
     {    
      fgets(buf,BUFSIZE,fp);         

/*allocation de memoire pour la ligne du tableau*/
      if ((plist = (struct recette *) realloc(plist,(i+1) * sizeof(struct recette)))
           == NULL)
        { 
          printf("\n\nPas assez de memoire !\n");
          i++;
          break;
        }

/*decoupe de la ligne en champ*/
      champs=g_strsplit(buf,":",0);

/*le numero de la recette*/
      plist[i].numero=atoi(champs[0]);

/*le nom de la recette*/
      strcpy(buffer,champs[1]);
      strcpy(plist[i].libelle,buffer);

/*la position de depart dans le fichier*/
      plist[i].rdebut=atoi(champs[3]);

/*la position de fin dans le fichier*/
      plist[i].rfin=atoi(champs[4]);
      i++;
      k++;
      }
  if (plist==NULL) plist = backup;
 fclose(fp);    
}



/* fonction de recherche dans le tableau*/
void cherche(char *rlibelle,gpointer data)
{
  int k;
  int nbtrouve=0;
  char *loc;
  char buf[61];
  int ligne =0;
  
/* le texte trouvé*/
   gchar *label;

/* la copie pour la clist*/
   gchar *texte[1][1];
   gchar *c1,*c2;

/*parcours le tableau*/   
for (k=0; k<10510; k++)
   {
    loc =NULL;
    
/*copie d'un element du tableau*/
    strcpy(buf,plist[k].libelle);
    
/*recherche de rlibelle dans buf*/
    
     (int *) loc = strcasestr(buf,rlibelle);
    
/* si c'est zero je passe*/
       if (loc != NULL) 
        {

/* copie de la chaine */
              label=g_strdup_printf(buf);

              texte[0][0] =label;

/* ajoute le resultat à la liste*/

              gtk_clist_append( (GtkCList *) data,texte[0]);
/*accroche numero au titre de la recette comme index*/	      
	      gtk_clist_set_row_data(GTK_CLIST(liste),ligne,(int *) plist[k].numero);
	      ligne++;
              g_free(label);

         }
    }
  return;
} /*fin de la fonction recherche*/






/* chaque frappe de caractére declanche une recherche*/

void changer(GtkWidget *saisie,gpointer data)
{      
/* efface la liste des resultats*/

   gtk_clist_clear( (GtkCList *) data);
  
/* lance la recherche */

   cherche(gtk_entry_get_text(GTK_ENTRY(entry1)),(gpointer) liste);
   return;
  
}


/*affiche la recette selectionnée*/
void selection_made( GtkWidget      *clist,
		     gint	     row,
		     gint	     column,
		     GdkEventButton *event,
		     gpointer	     data )
{
    gchar *text = NULL;

   int position;
        
/* renseigne les variables de la position de la recette */
    (int *) position=gtk_clist_get_row_data(GTK_CLIST(liste),row);
    vdebut=plist[position].rdebut;
    vfin=plist[position].rfin;

/*affiche la recette*/
    charge_recette(vdebut,vfin);

/*donne le focus a la zone de saisie*/
    gtk_widget_grab_focus(entry1);
    return;
}

void bouton_apropos_clicked( gpointer data )
{
    apropos();
    gtk_widget_grab_focus(entry1);
    return;
}
void bouton_imprimer_clicked( gpointer data )
{
   
/*buffer pour la lecture d'une ligne de recette*/
    char buf[BUFSIZE];
    int i,j;
    
    gchar *tampon;
/*ouverture du fichier temporaire pour l'impression*/
     if ((ftemp=fopen("/tmp/recette","w"))==NULL)
     {
      fprintf(stderr,"erreur a l'ouverture du fichier temporaire.\n");
      exit(1);
     }

/*copie du texte de la rectte dans le fichier temporaire*/
     tampon = gtk_editable_get_chars(GTK_EDITABLE(texte),0,-1);
     fwrite(tampon,strlen(tampon),1,ftemp);
     fclose(ftemp);
    
/* lance la routine d'impression */
    system("imprec");

/*focus a la zone de saisie */
    gtk_widget_grab_focus(entry1);
    return;
}
void bouton_noter_clicked( gpointer data )
{
    gtk_widget_grab_focus(entry1);
    return;
}

void bouton_quitter_clicked( gpointer data )
{
    free(plist);
    /*ferme le fichier recette*/
    fclose(fp);
    gtk_main_quit();
    return;
}


int main( int	 argc,
	  gchar *argv[] )
{
  GtkWidget *fenetre1;
  GtkWidget *table1;
  GtkWidget *bare_icone;
  GtkWidget *bouton_quitter, *bouton_imprimer, *bouton_noter, *bouton_apropos;
  GdkPixmap *pix_gdk;
  GdkBitmap *Mask;
  GdkColor transparent;
  GtkWidget *pix_sortie, *pix_imprimer, *pix_noter, *pix_apropos;
  GtkWidget *slabel;
  gtk_init(&argc, &argv);

/*la fenetre principale*/
  fenetre1 = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_object_set_data (GTK_OBJECT (fenetre1), "fenetre1", fenetre1);
  gtk_container_set_border_width (GTK_CONTAINER (fenetre1), 5);
  gtk_window_set_title (GTK_WINDOW (fenetre1), ("Gfaim"));
  gtk_window_set_default_size (GTK_WINDOW (fenetre1), 600, 400);
  gtk_window_set_policy (GTK_WINDOW (fenetre1), TRUE, TRUE, FALSE);
/*connection du signal */
  gtk_signal_connect(GTK_OBJECT(fenetre1),
		       "destroy",
		       GTK_SIGNAL_FUNC(bouton_quitter_clicked),
		       NULL);
/*la table de la fenetre*/
  table1 = gtk_table_new (3, 5, FALSE);
  gtk_widget_ref (table1);
  gtk_object_set_data_full (GTK_OBJECT (fenetre1), "table1", table1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_realize(fenetre1);
  gtk_widget_show (table1);
  gtk_container_add (GTK_CONTAINER (fenetre1), table1);

/* boite scroll pour la liste */
  scrolllist = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_ref (scrolllist);
  gtk_object_set_data_full (GTK_OBJECT (fenetre1), "scrolllist", scrolllist,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (scrolllist);
  gtk_table_attach (GTK_TABLE (table1), scrolllist, 0, 1, 1, 2,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolllist), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);


/*création de la liste*/
  liste = gtk_clist_new_with_titles( 1, NULL);
  gtk_widget_ref (liste);
  gtk_object_set_data_full (GTK_OBJECT (fenetre1), "liste", liste,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (liste);
  
  gtk_container_add (GTK_CONTAINER (scrolllist), liste);
  
/* connection du signale de selection */
    gtk_signal_connect(GTK_OBJECT(liste), "select_row",
		       GTK_SIGNAL_FUNC(selection_made),
		       NULL);
		       
/* texte zone de saisie */
  slabel=gtk_label_new("Rechercher :");
  gtk_widget_ref (slabel);
  gtk_widget_show(slabel);
  gtk_table_attach (GTK_TABLE (table1), slabel, 0, 1, 2, 3,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
/*création de la zone de saisie*/
  entry1 = gtk_entry_new ();
  gtk_widget_ref (entry1);
  gtk_object_set_data_full (GTK_OBJECT (fenetre1), "entry1", entry1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (entry1);
  gtk_table_attach (GTK_TABLE (table1), entry1, 1, 2, 2, 3,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);

/* connection du signal de saisie */
     
 
  gtk_signal_connect(GTK_OBJECT(entry1),"changed",(GtkSignalFunc)changer,(gpointer)
liste);


/*création de la zone d'affichage de la recette*/
  scrolltexte = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_ref (scrolltexte);
  gtk_object_set_data_full (GTK_OBJECT (fenetre1), "scrolltexte", scrolltexte,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (scrolltexte);
  gtk_table_attach (GTK_TABLE (table1), scrolltexte, 1, 5, 1, 2,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolltexte), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);

  texte = gtk_text_new (NULL, NULL);
  gtk_widget_ref (texte);
  gtk_object_set_data_full (GTK_OBJECT (fenetre1), "texte", texte,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_text_set_word_wrap(GTK_TEXT(texte),TRUE);
  gtk_widget_show (texte);
  gtk_container_add (GTK_CONTAINER (scrolltexte), texte);

/*la barre d'icone*/
  bare_icone = gtk_toolbar_new (GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_BOTH);
  gtk_widget_ref (bare_icone);
  gtk_object_set_data_full (GTK_OBJECT (fenetre1), "bare_icone", bare_icone,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (bare_icone);
  gtk_table_attach (GTK_TABLE (table1), bare_icone, 0, 4, 0, 1,
                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                    (GtkAttachOptions) (0), 0, 0);
  gtk_container_set_border_width (GTK_CONTAINER (bare_icone), 6);
  

  /*création des images dans les boutons */
    pix_gdk = gdk_pixmap_create_from_xpm_d(fenetre1->window,
    &Mask,&transparent,sortie_xpm);
    pix_sortie = gtk_pixmap_new(pix_gdk, Mask);
     
    pix_gdk = gdk_pixmap_create_from_xpm_d(fenetre1->window, &Mask,
    &transparent,imprime_xpm);
    pix_imprimer = gtk_pixmap_new(pix_gdk, Mask);
     
    pix_gdk = gdk_pixmap_create_from_xpm_d(fenetre1->window, &Mask,
    &transparent,note_xpm);
    pix_noter = gtk_pixmap_new(pix_gdk, Mask);
    
    pix_gdk = gdk_pixmap_create_from_xpm_d(fenetre1->window, &Mask,
    &transparent,apropos_xpm);
    pix_apropos = gtk_pixmap_new(pix_gdk, Mask);
     
    gdk_pixmap_unref(pix_gdk);
    gdk_pixmap_unref(Mask);

/* affichage des images des boutons */
    gtk_widget_show(pix_sortie);
    gtk_widget_show(pix_imprimer);
    gtk_widget_show(pix_noter);
    gtk_widget_show(pix_apropos);

/* creation des boutons */
    bouton_quitter = gtk_button_new();
    bouton_imprimer = gtk_button_new();
    bouton_noter = gtk_button_new();
    bouton_apropos = gtk_button_new();

/* bouton sans relief */    
    gtk_button_set_relief(GTK_BUTTON(bouton_quitter), GTK_RELIEF_NONE);
    gtk_button_set_relief(GTK_BUTTON(bouton_imprimer), GTK_RELIEF_NONE);
    gtk_button_set_relief(GTK_BUTTON(bouton_noter), GTK_RELIEF_NONE);
    gtk_button_set_relief(GTK_BUTTON(bouton_apropos), GTK_RELIEF_NONE);
  
/* ajout des images dans les boutons  */
     gtk_container_add(GTK_CONTAINER(bouton_quitter),pix_sortie);
     gtk_container_add(GTK_CONTAINER(bouton_imprimer),pix_imprimer);
     gtk_container_add(GTK_CONTAINER(bouton_noter),pix_noter);
     gtk_container_add(GTK_CONTAINER(bouton_apropos),pix_apropos);

/* affichage des boutons */
    gtk_widget_show(bouton_quitter);
    gtk_widget_show(bouton_imprimer);
    gtk_widget_show(bouton_noter);
    gtk_widget_show(bouton_apropos);
    

    gtk_toolbar_append_space(GTK_TOOLBAR(bare_icone));
    gtk_toolbar_append_widget(GTK_TOOLBAR(bare_icone),bouton_quitter,"Quitter GFaim",NULL);
    gtk_toolbar_append_space(GTK_TOOLBAR(bare_icone));
    gtk_toolbar_append_space(GTK_TOOLBAR(bare_icone));
    gtk_toolbar_append_space(GTK_TOOLBAR(bare_icone));
    gtk_toolbar_append_space(GTK_TOOLBAR(bare_icone));
    gtk_toolbar_append_space(GTK_TOOLBAR(bare_icone));
    gtk_toolbar_append_widget(GTK_TOOLBAR(bare_icone),bouton_imprimer,"Imprimer la recette",NULL);
    gtk_toolbar_append_space(GTK_TOOLBAR(bare_icone));
    gtk_toolbar_append_space(GTK_TOOLBAR(bare_icone));
    gtk_toolbar_append_space(GTK_TOOLBAR(bare_icone));
    gtk_toolbar_append_widget(GTK_TOOLBAR(bare_icone),bouton_noter,"Annoter la recette",NULL);
    gtk_toolbar_append_space(GTK_TOOLBAR(bare_icone));
    gtk_toolbar_append_space(GTK_TOOLBAR(bare_icone));
    gtk_toolbar_append_space(GTK_TOOLBAR(bare_icone));
    gtk_toolbar_append_space(GTK_TOOLBAR(bare_icone));
    gtk_toolbar_append_space(GTK_TOOLBAR(bare_icone));
    gtk_toolbar_append_space(GTK_TOOLBAR(bare_icone));
    gtk_toolbar_append_space(GTK_TOOLBAR(bare_icone));
    gtk_toolbar_append_widget(GTK_TOOLBAR(bare_icone),bouton_apropos,"A propos de GFaim",NULL);
    gtk_toolbar_append_space(GTK_TOOLBAR(bare_icone));


/* connection des signaux  des boutons */
    gtk_signal_connect_object(GTK_OBJECT(bouton_apropos), "clicked",
			      GTK_SIGNAL_FUNC(bouton_apropos_clicked),
			      (gpointer) liste);
    gtk_signal_connect_object(GTK_OBJECT(bouton_imprimer), "clicked",
			      GTK_SIGNAL_FUNC(bouton_imprimer_clicked),
			      (gpointer) liste);
    gtk_signal_connect_object(GTK_OBJECT(bouton_noter), "clicked",
			      GTK_SIGNAL_FUNC(bouton_noter_clicked),
			      (gpointer) liste);
    gtk_signal_connect_object(GTK_OBJECT(bouton_quitter), "clicked",
			      GTK_SIGNAL_FUNC(bouton_quitter_clicked),
			      (gpointer) liste);

  
/* donne le focus a saisie */
      
   gtk_widget_grab_focus(entry1);
   
/* charge le fichier index */
  lit_index();
  /*ouverture du fichier cuisine*/
    if ((fp=fopen(DATADIR"/cuisine.dat","rb"))==NULL)
     {
      fprintf(stderr,"erreur a l'ouverture du fichier cuisine.dat.\n");
      exit(1);
     }
  gtk_entry_set_text(GTK_ENTRY (entry1) ,"");
  apropos();
  gtk_widget_show (fenetre1);
  gtk_main ();
  return(0);
}
