It appears that in GTK you hold a reference to an object, for example like an GtkEntry
, but you hold it with a pointer to a GtkWidget
. For example
GtkWidget* pointer = gtk_entry_new();
Then when you want to do something like set the text of that entry, you have to call a function and do something with that pointer.
gtk_entry_set_text(GTK_ENTRY(pointer), "hello");
A few questions:
- What is the "GTK_ENTRY()" thing? Is it a function call or typecast?
- Why is it in all Capital letters, why not do something like (GtkEntry*)pointer?
- Why even do this? Why not return a GtkEntry pointer when you create a new Entry?