GigaRoc has asked for the wisdom of the Perl Monks concerning the following question:

I need to hide a row in a GTK SimpleList based on data in Column. Is there a simple way of doing this? without loading all the data into another array and then filtering it back into the first?

Replies are listed 'Best First'.
Re: Hide Row in GTK SimpleList
by zentara (Cardinal) on Jul 15, 2011 at 18:55 UTC
    Just guessing... :-)

    I don't have a perl example, but SimpleList inherits methods from from TreeView, and Googling for hiding rows leads to Gtk2::TreeModelFilter, which has a method $filter->set_visible_column. I've yet to see an example, but Kevin Ryde's Gtk2::Ex::TreeModelFilter::Change looks close, but you would have to use Gtk2::Ex::SimpleList. You might ask this on the Perl/Gtk2 maillist .

    The SimpleList is tied internally to it's list arrays, so why does it bother you to splice the rows in and out? That probably would be easiest. :-)

    I have seen this trick

    Is the only way to make a column hidden in a SimpleList by defining a +new type? Gtk2::SimpleList -> add_column_type( 'new', type => 'Glib::String', attr => 'hidden' );
    But then you would have to loop thru all columns for your row, a simple splice-in and out seems easiest.

    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku ................... flash japh