Re: widget arrays

Hi Clancy,

	The right mailing list for this request is: gnome-love gnome org

On Tue, 2002-08-20 at 16:06, Clancy, Shane W. wrote:
> 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.

	Why 20 ? it sounds like a nightmare of hard-coding.

> char *table1_labels[] = {"blah1", "blah2", "blah3",...};
> char *table2_labels[] = {"something1", "something2", ...};
> GtkWidget *entry[] = {"entry1", "entry2", "entry3", ...};

	But presumably you want to create the widgets as GtkWidgets' rather
than strings ?

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

	You need to pass gtk_frame_set_label a pointer to a valid GtkFrame,
otherwise you'll get mixed results ;-)

>   gcc is telling me that
> entry1, entry2, etc. are not defined.  is there an easy way to do this?

	gnome-love is the place to get this sort of help.



 mmeeks gnu org  <><, Pseudo Engineer, itinerant idiot

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