Re: Hiding individual TreeRows
- From: "Jonathon Jongsma" <jonathon jongsma gmail com>
- To: "Matt Bragano" <maestro485 comcast net>
- Cc: gtkmm-list gnome org
- Subject: Re: Hiding individual TreeRows
- Date: Fri, 26 May 2006 13:30:27 -0500
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]