diff options
| author | Abdellah El Morabit <nsrddyn@gmail.com> | 2024-11-29 13:24:16 +0100 |
|---|---|---|
| committer | Abdellah El Morabit <nsrddyn@gmail.com> | 2024-11-29 13:24:16 +0100 |
| commit | fdd3b103bb209045123693cd60149b951c7b2be8 (patch) | |
| tree | 1019543e2db0ec535f9a76c9f8527fa0ef299caa /bin | |
| parent | 446f3d4742f88b09c85e83e96f6505cd3f6302c5 (diff) | |
rewritten the source of the application
Diffstat (limited to 'bin')
| -rw-r--r-- | bin/display_driver.c | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/bin/display_driver.c b/bin/display_driver.c deleted file mode 100644 index adb845a..0000000 --- a/bin/display_driver.c +++ /dev/null @@ -1,53 +0,0 @@ -#include <gtk/gtk.h> -#include <stdio.h> -#include <string.h> - -// Define the features array -char *features[] = {"recourses", "greeting", "pomodoro", "weather", "speech", "command center"}; - -// Function to create a button with a label -void create_button(const char *label) { - GtkWidget *button = gtk_button_new_with_label(label); - // You can set the button properties or add it to a container here - g_print("Button created: %s\n", label); // For debugging purposes -} - -static void activate(GtkApplication *app, gpointer user_data) { - // Create the 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, 400); - - // Create a container for buttons (e.g., vertical box) - GtkWidget *vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5); - gtk_container_add(GTK_CONTAINER(window), vbox); - - // Calculate the number of features - int features_count = sizeof(features) / sizeof(features[0]); - - // Create a button for each feature - for (int i = 0; i < features_count; i++) { - GtkWidget *button = gtk_button_new_with_label(features[i]); - gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0); - gtk_widget_set_size_request(button, 50, 50); - } - - // Show all widgets - gtk_widget_show_all(window); -} - -int main(int argc, char *argv[]) { - // Create the application - GtkApplication *app = gtk_application_new("com.example.GTK4Test", G_APPLICATION_FLAGS_NONE); - - // Connect the "activate" signal to the callback function - 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; -} |
