nautilus view hacking


I am trying to wrap my head around creating a view for nautilus.  I hope 
to make an audio view using GStreamer but have started learning the ropes 
bit by bit.

The first thing I did was to extract the sample view from nautilus and 
make it buildable as a stand-alone project, which autotools and spec 
stuff handled.  I renamed it to a Test view instead because the nautilus 
sample view is actually included in nautilus in Red Hat, so that would 

After about three hours figuring out why the view didn't start up, I 
noticed that the location was picking up a wrong LIBEXECDIR ;)
I was wondering why the dialog message cannot be more specific as to why 
the view cannot start ? Not finding the binary seems like an easy thing to 
check for.  If you point me to the proper location I might give that a 

Next, I wanted to find an easy way of testing a nautilus view without 
doing this from nautilus, because it's really hard to debug it from within 
IMO (or maybe I don't know how, but I couldn't find any docs on how to 
make it easier).

So I wanted to find a way to try out the code in a separate process.

My first attemp was to write a sample test app that creates the nautilus 
view GObject, and calls some of the object manipulation functions 

Here's what I currently have :

#include <config.h>

#include "nautilus-test-view.h"

struct NautilusTestViewDetails {
        char *location;
        GtkWidget *label;

main (int argc, char *argv[])
        NautilusTestView *view;
        GtkWidget *top;

        gtk_init (&argc, &argv);
        view = (NautilusTestView *) g_object_new (nautilus_test_view_get_type (), NULL);
        top = gtk_window_new (GTK_WINDOW_TOPLEVEL);
        gtk_container_add (GTK_CONTAINER (top), view->details->label);
        gtk_widget_show_all (top);
        gtk_main ();

This seems alright at first glance (as far as I know anyway ;)), but 
segfaults, with the following backtrace :

#0  0x406a5aac in PortableServer_POA_servant_to_reference ()
   from /usr/lib/
#1  0x405c486a in do_corba_setup () from /usr/lib/
#2  0x407c843b in g_type_create_instance () from 
#3  0x407b264f in g_object_constructor () from 
#4  0x407b1e5e in g_object_newv () from /usr/lib/
#5  0x407b261f in g_object_new_valist () from /usr/lib/
#6  0x407b1c16 in g_object_new () from /usr/lib/
#7  0x0804949a in main (argc=1, argv=0xbffff8f4) at test.c:51
#8  0x420158d4 in __libc_start_main () from /lib/i686/

So it seems to crash in the corba/bonobo stuff (which I have no clue 

My guess would be that I probably should init the necessary library or 
somesuch, but if I have to figure this out on my own I'm probably not 
going to find it, so I thought that I'd ask here if

a) it is at all possible to test the gtk code of a view in this manner
b) if I should init bonobo or something else before doing the object 

If I can get this to work, I'll write down my experience, and I'll put the 
test view together with the test app in Gnome cvs so others can see how to 
start writing an external view and not have to go through the same 
mistakes as I have ;)

Thanks in advance,


The Dave/Dina Project : future TV today ! -
<-*- thomas (dot) apestaart (dot) org -*->
You came in just like smoke
With a little come on come on 
come on in your walk
come on
<-*- thomas  (at) apestaart (dot) org -*->
URGent, the best radio on the Internet - 24/7 ! -

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