From f2835b9bb0dc825740c6b51549172ac1c264543d Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Mon, 22 Apr 2024 18:50:52 +0200 Subject: [PATCH] une grille pour plusieurs boutons --- exec | Bin 16384 -> 16272 bytes main.c | 34 ++++++++++++++++++++-------------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/exec b/exec index 17423c4ad45035c7b8f479f990e32551667ae485..5058b60da71d4dc867b4a4fd47d800f3c277a522 100755 GIT binary patch delta 2620 zcmZ`5ZA?>F^u9-FDQ%&zMN1XO1C8iRS~~d<1X`xV!c3-_E@MV3T2SVM#??4C9gr|* z<%i&L3np6v+v4=c78G^r3?gQte>P3r9LB|u%;o)<6Xq9DW_QkgeMm}nl5_4opZDB* zZtl6w%|d%qd%EP4e2hS)j9EM8ev{m3;WE}~>A3DPj_6cw1SG+2Y!y_l6)KTyPEfhs z&>}pMg0jj5Wgnjedn4i^AuA0To2p?HIR!BmlSw$&L%G*svEnQdF%>Zhj))Ezb|pcc z&bri&l4L{!q8X9Eh-l)o7evG<*;0mj5+@OniE#OAn+q3U;0)nIIHz+6H;BTpE?xMN z^RGfyqC;3s6qY5X3%Q&(asFart}w{0j)A0iLr9-4$Xx$~N9ot4oA%-|w9S624?y3P zv|&qqFwjuD4OZn(ht~~>&S33(;Vq5Z*@p0@09S6P4F|&8L$%;HRKX!bj)_Za!r_|r z8+(PM2MO@llrfz)B(N&n9UT$Dv5wDhe;1EtLqq$%*Nv!{uk=UmDj!6n(F=)R!CYH)?e%}7QGcXjR5|jTCIkMqicx>$SAS$sxsR$o zos3H(V?(v_1-GdfR$3<+5AZnTKJ1TN@JFsGGTNLqp}TSdO6=*?sW?47+lJ{mV=;d~ zAEj=hBVRYjC4(4BDL+NmtNbLqF)_@QoEzcJ1P7S#c5kPs-`KTW4T(I$d%K0DPQce2Mv`~lk%vZ zoCgKr8y?@~Rr0+#7InszW`^pld^!d__GyMn%JkSXxMI&(Rz)XVjRLBgk^H}Yrk#OS z*`r)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|U=f!?t7A_?@NnvTAj8gJ_4{iI;2lNEMB*zf(b7tXpoycce` zo=*SRi^}Ho6>8*HZ70sxp8#M@TiN>cV_jDx6%VvaxC%A$mD*nMK#lyMMh3L2sJaj@ zQfhZ>Q*0<70^p z-g%@iHTSHU;g6B!nK8>~D*7K$at5@usOh-UM_E+&4asy{m-elG?svsJ&vCc6U{4L0P2YK5hwT9?&#|?G^X0^ih`f4JWDl zE+_T%?Dd?mL9di_M7B*=gZ1@|@@tJ->#JoCQ$w;xuAH%14%Y>@29w!_`p||=!D>+D zXJ&qXN7vuNI2oh5{tEJi$lH)VM1CH5&Rt#q8F>ialV|WVa7mt(eSSpOjqAkNG}Pr{ zFT^+sBzUGu`J?cxC&yEa0bV4l@)YMmX@SEMw}{&llh{NQ9mO8(33&!+!R}TC(?ZQ@ z@@VW2%|R5Oh{63a_<9V!9fR?ni)M=11OvB@J*3lO42oiKWei>ugBxNny)@J&8H{zB z*luFxRB!}dZ!%Y)$Qy7q#go8z_lb8ww|6pE;flA64}#S0Oxd^;c>duK^JS^4i^Tp6uS##nucE-rd&Wy3pKy!y#I z`xa``a5eO#Q9C3kW51Ese;1KUay99k#(Bnia?~y02Ci(*~#q_)&BI1dOvoeLqE~A{*7n_-DBIb3X{y)%$ zvKO0|heDps24nX|UeGo-KGVsvpNO0Td*^2HIf9lDO;{#jYU$U2SHY>dt)N>h|J6;S zz=AKY77DeQ{i>fg; z6-Lnozj1*y^H*m!_=|nXZu4HyMJUcsE;J!tk57y9UC~=pXWqO)7%gtaJGW(?FD-iD z>&)MhJAuQmF8DR6t -static void print (GtkWidget *widget, gpointer data) {g_print (data);} +static void print (GtkWidget *widget, gpointer data) {g_print (data);} static void activate (GtkApplication *app, gpointer user_data) { GtkWidget *window; + GtkWidget *grid; GtkWidget *button; - GtkWidget *box; -/* GtkBox GtkGrid GtkRevealer GtkStack - * GtkOverlay GtkPaned GtkExpander GtkFixed */ + window = gtk_application_window_new (app); gtk_window_set_title (GTK_WINDOW (window), "Window"); - gtk_window_set_default_size (GTK_WINDOW (window), 200, 200); - box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); - gtk_widget_set_halign (box, GTK_ALIGN_FILL); - gtk_widget_set_valign (box, GTK_ALIGN_CENTER); /* START CENTER END FILL */ - gtk_window_set_child (GTK_WINDOW (window), box); + grid = gtk_grid_new (); + gtk_window_set_child (GTK_WINDOW (window), grid); - button = gtk_button_new_with_label ("Hello World !"); + button = gtk_button_new_with_label (" I "); + g_signal_connect (button, "clicked", G_CALLBACK (print), "I'm n°1\n"); + gtk_grid_attach (GTK_GRID (grid), button, 0, 0, 1, 1); - g_signal_connect (button, "clicked", G_CALLBACK (print), "Hi ! I'm there\n"); -// g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_window_destroy), window); + button = gtk_button_new_with_label (" II "); + g_signal_connect (button, "clicked", G_CALLBACK (print), "I'm n°2\n"); + gtk_grid_attach (GTK_GRID (grid), button, 1, 0, 1, 1); - gtk_box_append (GTK_BOX (box), button); + button = gtk_button_new_with_label ("Quit"); + g_signal_connect (button, "clicked", G_CALLBACK (print), "bye !...\n"); + g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_window_destroy), window); + gtk_grid_attach (GTK_GRID (grid), button, 0, 1, 2, 1); gtk_window_present (GTK_WINDOW (window)); } -int main (int argc, char **argv) { +int +main (int argc, + char **argv) +{ GtkApplication *app; int status; @@ -38,3 +43,4 @@ int main (int argc, char **argv) { return status; } +