Re: Hiding individual TreeRows
- From: Matt Bragano <maestro485 comcast net>
- To: Jonathon Jongsma <jonathon jongsma gmail com>
- Cc: gtkmm-list gnome org
- Subject: Re: Hiding individual TreeRows
- Date: Fri, 26 May 2006 14:42:49 -0400
Jonathon Jongsma wrote:
On 5/26/06, Matt Bragano <maestro485 comcast net> wrote:
Hi all,
I've been experimenting with different ways to hide individual TreeRows
on the fly, but with limited success. Basically if a row's name begins
with a " . " then I'd like to hide it, but not necessarily erase it from
the TreeView using erase() since I'd like to be able to reverse this
action without recreating the entire view. I was looking around the
mailing list archives and I stumbled upon this post:
http://marc.theaimsgroup.com/?l=gtkmm&m=109957757907166&w=2
using the cell_data_func, you'd be able to customize the data that
gets displayed in the particular cell, but I don't think you'd be able
to hide the row entirely. GTK makes it easy to selectively hide or
display certain columns from your model, but I don't know of any easy
way to show or hide rows from the model. The only way I can think of
to hide a row entirely would be by creating a custom TreeModel
(something I've been experimenting with lately), but there's not a lot
of documentation about doing that, and it's a bit advanced for
somebody just learning gtkmm.
If you're up for a challenge, you might try looking through the
nautilus source code to see how they do it, since nautilus has an
option for whether to display 'hidden' files. It's written in GTK+,
but the basic concepts should be the same for gtkmm. For all I know,
they might just rescan the directory each time the option is changed
(which would be more-or-less equivalent to what you're doing by
erasing the items from the model), but they might have a more clever
way as well.
Perhaps somebody else has a better idea, though...
Jonner
I was browsing around the xffm source since I'm using xfce on this
machine, and xffm (the file manager) also includes the option to hide
hidden files. It is a bit easier to browse through since xffm is a
rather small program as far as file managers are concerned. I'm still
trying to get a bearing on the whole thing, but I'll post back if I find
something useful.
Matt Bragano
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]