Create window

This commit is contained in:
2025-12-02 17:11:38 +05:00
parent 16448ef9b8
commit bbb77e1291
4 changed files with 34 additions and 0 deletions

18
main.c Normal file
View File

@@ -0,0 +1,18 @@
#include <gtk/gtk.h>
static void app_activate (GtkApplication *app, gpointer *user_data){
GtkBuilder *builder = gtk_builder_new_from_file("builder.ui");
GObject* window = gtk_builder_get_object(builder, "window");
gtk_window_set_application(GTK_WINDOW(window),app);
g_object_unref(builder);
gtk_window_present(GTK_WINDOW(window));
g_print("Started\n");
}
int main (int argc, char **argv){
GtkApplication *app = gtk_application_new ("file.manager", G_APPLICATION_DEFAULT_FLAGS);
g_signal_connect (app, "activate", G_CALLBACK(app_activate),NULL);
int status = g_application_run (G_APPLICATION (app), argc, argv);
g_object_unref(app);
return status;
}