on-internet
← Community

Why isn't the GtkWidget pointer not being initialized when passed to a separate function to initialize?

Stack Overflow ·

I'm trying to create reusable functions, to avoid repetition. The function createBox(GtkWidget)** which assigns the parameter box a pointer to a box widget. I have checked the parameter box is assigned a pointer inside the function createBox(GtkWidget***)** but the same variable is NULL inside the initAppWindow(GtkApplication) function even though the **createBox(GtkWidget) **function is called. The same happens with the createButton() function. #include <stdio.h> #include <gtk/gtk.h> void createButton(GtkWidget *button, char *text, void (*onPressed) (GtkWidget*, gpointer)) { button = gtk_butt

Comments

Sign in or sign up to comment and upvote.

No comments yet.