Re: I need advises ;)



Jerome Le Saux wrote:
Hi all ,
I'm a french developer (so sorry for my unusual english ;)).
I'm trying to include in a project a GTK2.0 interface.
The squeleton of the interface is made, but now I need to plug my code to
the interface.
First question in a function, I what to put in a Gtk list a C structure
which is composed like folow :
typdef struct {
char* FileName[13];
int Length;
int User;
} mystruct;

I would like to put a pointer of my structure (64 mystruct), in a gtk list.
I would like that this list will be displayed in a scrolled window, and each
line would be selected by a mouse event.
One structure displayed by line.

So my question is
which gtk list do you advise me ? And how to store my pointer of structure
to that list ?
It have got all the properties quoted above. It means one structure by line,
and it can be selected by a mouse even ?

GtkTreeView. You may not need to store a pointer to the structure, because you'll have all the fields from the structure in the tree view. Keeping the structure around would mean storing all the data in it twice. But if you decide you still want to do that, you can put the pointer in userdata.

--
Guy Rouillier



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