easy gtk-programm fault



hallo everybody,

since some days i try to code my first gtk program. it 's not more than a window with a label in it.
the code is that:
#include <gtk/gtk.h>


int main( int argc,
                char *argv[] )
{
        GtkWidget *window1;
        GtkWidget *label1;
gtk_init (&argc, &argv);

        window1 = gtk_window_new (GTK_WINDOW_TOPLEVEL);
        label1 = gtk_label_new ("Hallo Du");

        gtk_container_add (GTK_CONTAINER (window1), label1);
gtk_widget_show (label1); gtk_widget_show (window1);
//     sleep(1);
//      gtk_label_set_text (label1,"wie gehts?");
gtk_main ();

        return 0;
}

there is no thing to warry about.
but my aim is to change the text in the label. and if i uncomment the "gkt_label_set_text ..."-line, gcc (gcc label.c `pkg-config --cflags --libs gtk+-2.0`) shows a warning:
label.c: In Funktion »main«:
label.c:22: Warnung: Verarbeiten des Argumentes 1 von »gtk_label_set_text« von inkompatiblem Zeigertyp
which means that the "label1" in the "set_text"-line is a incompatible pointertype, i think.

do anybody know, what i'm doing wrong?

thanks,
daniel.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]