Re: About gtk_clist_set_row_data



I think you misunderstand what happens with gtk_clist_set_row_data  -  it
simple assigns a pointer to the clist row so that that pointer can latter be
retrieved with gtk_clist_get_row_data.  The data need not (and usually does
not ) have anything to do with the number of columns in your clist.

It sounds like what you are trying to do is set or change the text that
appears on the displayed widget?

try gtk_ctree_set_text





Jean-Christophe Berthon wrote:

> Thank you Mohamed and Jim for your answers.
> Well I didn't find that much info in the FAQ neither in the tutorial (they
> say the prototype of the function should speak by itself... well not for
> me!)
> I was interested to see if I could post a structure with any kind of data
> via this function. So after your answer, I've try on one of my GUI which
> contain a CList (with 11 columns) to set up a structure and send it via
> gtk_clist_set_row_data. It didn't succeed. I had about 10 fields with int
> and one with char [] but nothing appear.
> Here is a sample code of what I wrote :
>
>  GtkWidget     *lstPA_ListOfPA;
>  Toto    essai;
>
>  essai.a = 1;
>  essai.b = 2;
>  essai.c = 3;
>  essai.d = 4;
>  essai.e = 5;
>  essai.f = 6;
>  essai.g = 7;
>  essai.h = 8;
>  essai.i = 9;
>  essai.j = 0;
>  strcpy(essai.k, "hello");
>
>  lstPA_ListOfPA = lookup_widget(aWindowsInfo_X.paIUPAData->wndPA,
>    "lstPA_ListOfPA");
>
>  gtk_clist_freeze(GTK_CLIST(lstPA_ListOfPA));
>  gtk_clist_set_row_data(GTK_CLIST(lstPA_ListOfPA), 0, (gpointer)&essai);
>  gtk_clist_thaw(GTK_CLIST(lstPA_ListOfPA));
>
> Best regards,
> ---
> Jean-Christophe Berthon
>
> Cap Gemini -- Ernst & Young
> France
> Skill Integration System -- Image Quality
> Email: Jean-Christophe Berthon cgey com
> Tel: (+33) 561 31 6639
>
> ----- Original Message -----
> From: "Mohamed" <mohamed 7val com>
> To: "Jean-Christophe Berthon" <jberthon capgemini fr>
> Sent: Monday, September 10, 2001 3:25 PM
> Subject: Re: About gtk_clist_set_row_data
>
> > Salut Jean
> >
> >
> >
> > you can attach  any type of data you want to the given row
> >
> >
> > simple example :
> >
> > you want to attach a color name to each row :
> >
> >
> > ------------>8------------
> > static gchar *couleur[3]={"vert","bleu", "rouge"} ;
> >
> > for (i=0; i<3; i++)
> >   gtk_clist_set_row_data (clist, i, (gpointer) couleur[i]);
> >
> > ------------->8-----------
> > or attach some kind of data  like
> >
> > typedef struct {
> >        gint myint;
> >       gchar *mychar
> > }SomeStruct;
> >
> > SomeStruct * data;
> >   gtk_clist_set_row_data (clist, i, (gpointer) data);
> >
> >
> >
> > bye
> >
> >
> >
> > On Mon, Sep 10, 2001 at 03:10:44PM +0200, Jean-Christophe Berthon wrote:
> > > Hello,
> > >
> > > I would like to know what kind of "row" (or data) I can give to the
> function
> > > gtk_clist_set_row_data?
> > >
> > > I'm explaining it better. Here is the prototype of
> > > gtk_clist_set_row_data(GtkCList* clist, int row_number, gpointer data)
> How
> > > do I have to format the data I'm giving to this function? Can I pass
> > > integers and floats, or is it only char*?
> > > If you have any knowledge about it, or any example, I would be glad :-)
> > >
> > > Thanks a lot in advance.
> > >
> > >
> > > Best regards,
> > > ---
> > > Jean-Christophe Berthon
> > >
> > > Cap Gemini -- Ernst & Young
> > > France
> > > Skill Integration System -- Image Quality
> > > Email: Jean-Christophe Berthon cgey com
> > > Tel: (+33) 561 31 6639
> > >
> > >
> > >
> > >
> > > _______________________________________________
> > > gtk-list mailing list
> > > gtk-list gnome org
> > > http://mail.gnome.org/mailman/listinfo/gtk-list
> >
> > --
> > Sevenval AG  (HRB 32757)
> > ecommerce-base-technologies
> > D-50667 Koeln . Am Alter Markt 36-42
> > Fon +49 221 65007-51
> > www.sevenval.de
> > Mohamed 7val de
> > ......................................
> >
> > Mohamed Elassadi
> > Programmierer
>
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list





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