widget arrays



all,
i am working on a gnome program that will have database accessability.  the
user will have the choice of which tables to manipulate, but no tables have
more than 20 columns.  i have 20 gnome_entry widgets with a frame around
each for data entry.  when the user selects which table he/she wants to
manipulate, i would like to have the labels on my frames change to
correspond to the columns in that table.  here is something like what i want
to do:

char *table1_labels[] = {"blah1", "blah2", "blah3",...};
char *table2_labels[] = {"something1", "something2", ...};

GtkWidget *entry[] = {"entry1", "entry2", "entry3", ...};

if (user selects table 1)
  {
    for (i = 0; i < 20; i++)
      {
        gtk_frame_set_label (entry[i], table1_labels[i]);
      }
  }

i would like to avoid coding a gtk_frame_set_label for every column in every
table. the method i've tried (above) does not work.  gcc is telling me that
entry1, entry2, etc. are not defined.  is there an easy way to do this?

thanks,
shane



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