GTK+2 Programming Part II
TreeView, ListStore


The code example-liststore.c builds on example-label2.c to add a List of files.  The User can now drag & drop multiple files or select multiple files with the File Selector.
The functions DropFiles and SelectFile now pass a pointer to a GtkListStore and they call a new function AddFile.
The List has 5 elements, a string for the filename (this is shown in the list), an int64_t for the file size, an integer for the modified time, an integer flag (boolean) set if the file is actually a directory, and another string for the path (this is shown as a tooltip, clever, huh?).

Compile and link:

gcc -Wall `pkg-config --cflags --libs gtk+-2.0` -o liststore-demo example-liststore.c

The GetInfo function does not call stat anymore since the list stores the file info in the GtkListStore, which is a good place to store a list.
All the string pointers are initially set to NULL for 2 reasons.  Actually, it's the same reason: If the "changed" signal is triggered and there is no list item selected, all the labels will be cleared of text (which is nice) and it is always safe to free a NULL pointer (which is also nice).
The 4th label, which displays the path to the file, no longer resizes the window.  Ellipsis are inserted when the path text is bigger than than the label.
Fun fact: This example code eventually became ArcProphet