From 2b30f6d7ecc8ba56e5a2e98f9937b6603672d6bb Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Mon, 22 Apr 2024 18:40:30 +0200 Subject: [PATCH] first window + un seul bouton --- Makefile | 11 ++++++----- exec | Bin 0 -> 16384 bytes main | Bin 16304 -> 0 bytes main.c | 53 ++++++++++------------------------------------------- 4 files changed, 16 insertions(+), 48 deletions(-) create mode 100755 exec delete mode 100755 main diff --git a/Makefile b/Makefile index ed08dd6..72a96b0 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,19 @@ all: Getting_Started_with_GTK +CC=gcc +CFLAGS=`pkg-config --cflags gtk4 --libs gtk4` WARNINGS = -Wall DEBUG = -ggdb -fno-omit-frame-pointer OPTIMIZE = -O2 -Getting_Started_with_GTK: Makefile main.c - $(CC) -o $@ $(WARNINGS) $(DEBUG) $(OPTIMIZE) main.c +Getting_Started_with_GTK: main.c + $(CC) $(CFLAGS) $(WARNINGS) $(DEBUG) $(OPTIMIZE) -o $@ main.c clean: rm -f Getting_Started_with_GTK + rm -f exec # Builder will call this to install the application before running. install: @@ -18,7 +21,5 @@ install: # Builder uses this target to run your application. run: - ./main - -# gcc $( pkg-config --cflags gtk4 ) -o main main.c $( pkg-config --libs gtk4 ) + ./exec diff --git a/exec b/exec new file mode 100755 index 0000000000000000000000000000000000000000..17423c4ad45035c7b8f479f990e32551667ae485 GIT binary patch literal 16384 zcmeHOeT*B$6`ylHA#is|AiY2VlZF=B+GpRVFMMP#$z6Q(5<&%<&dti9b)6~SMc-T!0xt+@;4q2a!?Fw;LU?Fxf zlh~E)3bq)Kg>Xo`1*ugdddg!p5M3(d763)PHmq!EJ~K1(lfqoqf5TFm=V zK}iqYg?f_ElY}181Hzv~$)7lUJQBiQVu1u4@)or|aeb`f)Y~ug_6vEUULjAEe1F^P zrus?x+a~meg~4IrPog)7{)ke4w}Kw}<=-u|%-cnOZtHMT_>-tuPSzeb#@h2{Ca1Nh zjGjbcbY#5PlkSVFYG1yuH>;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~7AWHQ))ou@t$^3&_lqy$ zF?*Zx-=!$)he`vSz24(<7suhOl;4!mZDQMEv01ZuPS5V9!sVM-UY>8j^0K*x{GJ+kp$7h~8u+s{@OL@hEN z{_ASscL46M8mVBm*N|uNf*n$Fkoc^{Ox4zs46~k_av~-m+B9R z>n7%_@7}&q9oVr6)A}j-zuJMw!-tW=2Ld9oovDT;GV`TN%HUVkSg|N&Jf9F?)LdT% z$YlL_J}i(Xouk8);#k(!VnFSJped@srwT?P&lD?X8w#ZSDv;5eHwyNcg!(sZ4d5xs z+frIF#T0$a0(*km1<^8M6pHY1L=~e#8yqPO6=W@+v6;f7rr1Ua>il>sg&aTc6eFc3 z3R>1sQ#$ApCp1*8P|%=Ps6llwtYytOc+G(=*eTqBFa~jCN<5d%;)fCcje_e#m^$Dd zDN0*ogjeW0z?~8&g0k*%6EL_2BmI=rr|;e(Zegg?`ix-w&c&@y_j~&O%};`o()yI( zC{%E%N&e4B|7YaF@);>e>s0bjb~Zu#hp^@&eOl-8j7Vss^|4o9nq@nnf@@sTr*-hS zbTBCchGWDk`KR^heSl$CNuSo$Dd~{b(ICQ$G)F9Z2x_>7C4E}A9*_&~byAZ0PjW=l z(2i?j;%QxcROR_Sg1;Nd(dx)Qaid)|=@8^E0@Am{;!nl&+<+~nz=R4h2(f&LI zMzD^aWZBameOf17S}r8$`Gw@=X+ID0yN1e}0M6KwKwb)H-4`%teu@kDpRa8L7{i3THWza`tN!4X}x$z>eup5WQeRY?QfI&=(J58j& z#z91d^xf1scU`jQrNJ55F`S3-w*~4C&7XLEP~TnZ>`a&7G>>ueOR{*G&ZmD%uaIc; ID0o=*FD3LsQUCw| diff --git a/main.c b/main.c index 6edfd95..8d9feb5 100755 --- a/main.c +++ b/main.c @@ -1,64 +1,33 @@ -/* main.c - * - * Copyright 2024 Jean - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * SPDX-License-Identifier: GPL-3.0-or-later - */ - #include -static void -print_hello (GtkWidget *widget, - gpointer data) -{ - g_print ("Hello World\n"); -} +static void print (GtkWidget *widget, gpointer data) {g_print (data);} -static void -activate (GtkApplication *app, - gpointer user_data) -{ +static void activate (GtkApplication *app, gpointer user_data) { GtkWidget *window; 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_CENTER); - gtk_widget_set_valign (box, GTK_ALIGN_CENTER); - + 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); - button = gtk_button_new_with_label ("Hello World"); + button = gtk_button_new_with_label ("Hello World !"); - g_signal_connect (button, "clicked", G_CALLBACK (print_hello), NULL); - g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_window_destroy), window); + 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); gtk_box_append (GTK_BOX (box), button); gtk_window_present (GTK_WINDOW (window)); } -int -main (int argc, - char **argv) -{ +int main (int argc, char **argv) { GtkApplication *app; int status; @@ -69,5 +38,3 @@ main (int argc, return status; } - -