I can\'t seem to be able to use the function
gtk_label_set_text();
this is what I write:
#include
int main(
As it is C code, you have apply a "cast" your pointer since gtk_label_new
returns the "base class" or structure:
╰── GtkWidget
╰── GtkMisc
╰── GtkLabel
╰── GtkAccelLabel
The cast is done through a macro (see here) code:
GtkWidget *label;
//label
label = gtk_label_new("This is my label");
gtk_label_set_text(GTK_LABEL (label), "I cannot use this func");
Note: in C++ no need to cast since GtkLabel
structure inherits from GtkWidget
, you could store label in a GtkLabel
directly, but there's no such thing as inheritance in C.