Re: extending fm_list_view



On Mon, 2006-07-03 at 15:45 -0600, Mark Kegel wrote:
> I'm attempting to write a new nautilus view (a clone of Finder's
> column view) and am trying to extend the current implementation of
> fm_list_view to get the job done. I need to be able to display
> multiple list views, one for each column. So far I have tried creating
> multiple list views and adding them to an hbox (also tried a scrolled
> window). It didn't work, and gave the following errors:

Its not as simple as that unfortunately.

> (nautilus:20712): Gtk-WARNING **: Attempting to add a widget with type
> GtkTreeView to a container of type GtkHBox, but the widget is already
> inside a container of type FMListView, the GTK+ FAQ at
> http://www.gtk.org/faq/ explains how to reparent a widget.
> 
> (nautilus:20712): GLib-GObject-WARNING **: invalid cast from `GtkHBox'
> to `NautilusView'
> 
> I would really like to be able to reuse the existing code. How can I
> have multiple FMListView objects contained in the same
> widget/container/whatever and have them all display without getting
> the errors I have above? Do I need to subclass FMListView (or maybe
> even NautilusView) or am I missing something? Do I need to reparent
> the FMListView widget? Thanks for your time.

There can only be one NautilusView in a nautilus window. You really need
to have a single view object that does everything needed for the
multi-list view. Of course, you might still be able to reuse code, just
not so simple.

Anyway, creating a multi-list view is certainly not gonna be trivial.
Without spending lots of time looking into it I couldn't say what the
best approach to do it would be. I'm not sure the FMListView code is an
ideal start for it though, as that has a lot of complexity due to it
already handling opening subdirectories as a tree.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's an immortal moralistic rock star on the edge. She's a mentally unstable 
thirtysomething mermaid in the witness protection program. They fight crime! 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]