GtkWidgets in multi-dimensional arrays (of pointers)



In my program, I want to be able to change a bunch of widgets (gtk labels) at
the same time. So, I've made a two dimensional array to hold my widgets like so:

GtkWidget *main_table[4][5];

Now, what I've tried to do is pass this to a function, but it doesn't seem to
work...

Here's what my function looks like:

void update_table(GtkAdjustment *adj, GtkWidget **target)
{
        int a, b;
        gchar widget_name;

        for(a=0;a<4;a++) {
                for(b=0;b<5;b++) {
                        widget_name = gtk_widget_get_name(target[a][b]);
                        g_print("%s\n", widget_name);
                }
        }
        
        return;         
}

GtkWidget **target is supposed to accept my main_table array, but for some
reason it's not working...

What am I doing wrong?

Sincerely,

Gordon E.

P.S.    If there's an easier way to update a bunch of widgets at once without
writing a seperate function for each one, please, please, please let me know!!!




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