Re: GtkTreeModel
- From: Christer Palm <palm nogui se>
- To: edscott imp mx
- Cc: gtk-list gnome org
- Subject: Re: GtkTreeModel
- Date: Tue, 02 Sep 2003 05:40:30 +0200
Hello Edscott!
edscott wilson garcia wrote:
The tricky part is what happens if the user tries to expand a
subdirectory which doesn't happen to contain any subdirectories. Just
like the Windoze explorer (cough) directory view, I want the expander
for that directory to "magically" disappear when the user tries to
expand it.
Use gtktreestore model. Add a dummy for non expanded directories. That
makes the expander appear. When the user expands, if nothing is in
there, collapse the node and remove the dummy. Since there will be no
children, the expander disappears.
Hmm.. Yeah - that should work I guess. Although it feels a bit backward
from an object-oriented point-of-view.
But what would you do if some other
process or whatever creates a file in that directory? You will not be
able to expand it, unless you are constantly monitoring the contents.
The view is transient so I don't think that would be a real problem. But
I could easily add some kind of (user activated) refresh mechanism if
that would be necessary. If I store the last modified timestamp along
with the directory name, it would just be a matter of checking whether
the timestamp has changed.
--
Christer Palm
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]