summaryrefslogtreecommitdiff
path: root/bin/display.c
diff options
context:
space:
mode:
authorAbdellah El Morabit <nsrddyn@gmail.com>2024-11-18 19:23:17 +0100
committerAbdellah El Morabit <nsrddyn@gmail.com>2024-11-18 19:23:17 +0100
commit2feb019c373c99fa3840d99724f5ee6f7c4dac36 (patch)
tree9bf1d614b602149a0ef27078894d6a15ecb13ff0 /bin/display.c
parent3714c08a1233884696e0f5483d73efa890e1a5a1 (diff)
started switching to c, started the web gui, started the gtk gui, ending the swift version
Diffstat (limited to 'bin/display.c')
-rw-r--r--bin/display.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/bin/display.c b/bin/display.c
new file mode 100644
index 0000000..51a0873
--- /dev/null
+++ b/bin/display.c
@@ -0,0 +1,27 @@
1#include <gtk/gtk.h>
2
3static void activate(GtkApplication *app, gpointer user_data) {
4 // Create a new application window
5 GtkWidget *window = gtk_application_window_new(app);
6 gtk_window_set_title(GTK_WINDOW(window), "I2C CONTROLLER");
7 gtk_window_set_default_size(GTK_WINDOW(window), 400, 200);
8
9 // Show the window
10 gtk_window_present(GTK_WINDOW(window));
11}
12
13int main(int argc, char *argv[]) {
14 // Create a new GtkApplication
15 GtkApplication *app = gtk_application_new("com.example.GTK4Test", G_APPLICATION_FLAGS_NONE);
16
17 // Connect the activate signal
18 g_signal_connect(app, "activate", G_CALLBACK(activate), NULL);
19
20 // Run the application
21 int status = g_application_run(G_APPLICATION(app), argc, argv);
22
23 // Clean up
24 g_object_unref(app);
25
26 return status;
27} \ No newline at end of file