Set Label Text



I have a problem,
i want to overwrite a label with a message for a specified time and want

to bring the original message back after that.
But the following code doesn´t do that:

void ndisplay_text(GtkWidget * label,gchar *text,guint sec)
{
char * tmpstring;
gtk_label_get(GTK_LABEL(label),&tmpstring);
gtk_label_set(GTK_LABEL(label),text);
gtk_widget_show(label);
sleep(sec);
gtk_label_set_text(GTK_LABEL(label),tmpstring);
}

The line with the gtk_label_set destroys my tmpstring how could i change

this routine to work correctly ??

--
Andreas Scherf
+-------------------------------------------+
I EMail   : scherfa@fh-trier.de             I
I Homepage: http://www.fh-trier.de/~scherfa I
+-------------------------------------------+





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