Re: [gnome-db] bug with gnome_db_grid_get_row_data



On Thu, 2004-01-15 at 02:34 +0100, Philippe CHARLIER wrote:
> Hi,
> 
> This question was submitted on 23/12/2003.
> An answer seems to be given by Rodrigo but did not appear on the list.
> Is it possible to send it back, I have exactly the same problem:
> 
> To get the data from a selected row in a Grid.
> 
> Thanks in advance.
> 
> Phil
> 
> Le mar 23/12/2003 à 17:12, Frédéric Logier a écrit :
> > I have some trouble with gnome_db_grid_get_row_data().
> > I get selected row with gnome_db_grid_get_selection(), it works
> > perfect, but i can't get row data,  gnome_db_grid_get_row_data return
> > a NULL pointer for each row selected.
> > 
> > This is my function, thanks for your help.
> > 
> > void on_dbgrid_customer_row_selected (GtkWidget *dbgrid, gpointer user) {
> > 
> >   GList *pRowSelected = NULL;
> >   gpointer row = NULL;
> > 
> >   pRowSelected = gnome_db_grid_get_selection (GNOME_DB_GRID (dbgrid));
> > 
> >   if (pRowSelected) {
> >     g_printf("row = %d\n", pRowSelected->data);
> >     row = gnome_db_grid_get_row_data (GNOME_DB_GRID (dbgrid), pRowSelected->data);
> >     g_printf("data =%s\n", row);
> >   }
> > 
> > };
> 
the problem is that get_row_data is not for retrieving the row's data,
as returned from the DB. For that, you use the GdaDataModel being
displayed by the grid (gnome_db_grid_get_model). get_row_data is for
retrieving the user data associated with the row, which apps can set
with gnome_db_grid_set_row_data. It is just for allowing apps to
associate extra data structures with each row.

cheers




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