Re: Folder Selection List.
| From: | Scott Mattocks | Date: | Fri, 10 Nov 2006 18:17:50 +0000 |
| Subject: | Re: Folder Selection List. | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-7454@lists.php.net to get a copy of this message | ||
Hi Nick,
NickCoons wrote:
That is, I want to create a folder list such that the folders can be expanded out, and each folder will have a checkbox next to it that can be checked. When a button is clicked (for instance, "Save"), I'm able to retrieve the list of checked folders. The difference between the above image and what I want is that 1) I don't want files listed, just folders, and B) the size listing is nice, but not important if it's not easily doable. It would also be great if a folder had a subfolder that was checked, the folder would have a gray check to indicate that some of its child objects had been selected.I don't have any code to show you but the way I would go about it is using a GtkTreeView. The You would build the list of folders yourself maybe using a recursive file iterator or something. That list should be used to populate a GtkTreeStore which is put into the model. The checkbox and what not can be done by packing a few GtkCellRenderers into the treeview column. The display may not be exactly the same (although it is probably possible with a little more work), but the functionality should be doable. I hope that helps, -- Scott Mattocks Author of: Pro PHP-GTK http://www.crisscott.com