Re: [gtk-list] Set Label Text



On Thu, 4 Mar 1999, Andreas Scherf wrote:

> 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);
> }
> 

make a local copy of the tmpstring ...

alex

> 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
> +-------------------------------------------+
> 
> 
> 
> -- 
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null
> 

Alexander Peuchert
mailto:peuc@comnets.rwth-aachen.de



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