From 2feb019c373c99fa3840d99724f5ee6f7c4dac36 Mon Sep 17 00:00:00 2001 From: Abdellah El Morabit Date: Mon, 18 Nov 2024 19:23:17 +0100 Subject: started switching to c, started the web gui, started the gtk gui, ending the swift version --- bin/display.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 bin/display.c (limited to 'bin/display.c') 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 @@ +#include + +static void activate(GtkApplication *app, gpointer user_data) { + // Create a new application window + GtkWidget *window = gtk_application_window_new(app); + gtk_window_set_title(GTK_WINDOW(window), "I2C CONTROLLER"); + gtk_window_set_default_size(GTK_WINDOW(window), 400, 200); + + // Show the window + gtk_window_present(GTK_WINDOW(window)); +} + +int main(int argc, char *argv[]) { + // Create a new GtkApplication + GtkApplication *app = gtk_application_new("com.example.GTK4Test", G_APPLICATION_FLAGS_NONE); + + // Connect the activate signal + g_signal_connect(app, "activate", G_CALLBACK(activate), NULL); + + // Run the application + int status = g_application_run(G_APPLICATION(app), argc, argv); + + // Clean up + g_object_unref(app); + + return status; +} \ No newline at end of file -- cgit v1.2.3-70-g09d2