strange problem
- From: Eamonn Martin Galvin <galvin student cs ucc ie>
- To: gtk-list gnome org
- Subject: strange problem
- Date: Mon, 26 Mar 2001 20:05:55 +0100 (BST)
> I have code that looks like this:
>
> char tmp[2] = {0};
> char *tok[256]; //this contains 256 2 character strings
>
> for (y=0; y<256; y++)
> {
> strcpy (tmp,tok[y]);
> //printf("tmp is %s\n",tmp);
> gtk_label_set_text(GTK_LABEL(
> labelArray[y]),tmp);
> }
>
>
> If I comment out the gtk_label_set_text and include the printf statement, it
> works fine. However when i include gtk_label_set_text tmp gets totally screwed
> up - printf jump prints rubbish. I cant understand what gtk_label_set_text is
> doing to change the tmp variable.
>
> Any ideas?
>
> Or a better way to tokenize 256 labels (they are read from a file into a
> buffer of 1 line) and write them back into a labelArray?
>
> Eamonn
P.S I tried passing the tmp variable to a seperate function to set the
text but it made no difference.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]