Why isn't the GtkWidget pointer being initialized when passed to a separate function to initialize?
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_button_new_wi
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.