glib g_array_sized_new problem



glib/gtk experts:

When I call the glib function g_array_sized_new I was expecting that
the array would be filled with NULL values since the 2nd argument
(the "clear" argument) is set to TRUE.  Since I'm setting the size to
10, I was expecting the array to be full of 10 NULL array pointers.

    my_array = g_array_sized_new (FALSE, TRUE,
      sizeof(gchar *), 10);
      
However, it doesn't work this way.  I have to then call this function
to actually init the values to NULL:

    g_array_set_size(obj->column_description, num_cols);

Is this the way it is supposed to work?  I didn't find the docs very
clear about this.

You probably can already see this, but when I compile code that includes
"gtk.h", I get these warnings (using the CVS head of today):

/opt/gnome-2.0/include/gtk-2.0/gtk/gtkwindow.h:134: 
  warning: `GTK_WINDOW_GET_CLASS' redefined
/opt/gnome-2.0/include/gtk-2.0/gtk/gtkwindow.h:47:
   warning: this is the location of the previous definition

Brian





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