nautilus view hacking



Hello,

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 
clash.

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 
try.

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 
directly.

Here's what I currently have :

#include <config.h>

#include "nautilus-test-view.h"

struct NautilusTestViewDetails {
        char *location;
        GtkWidget *label;
};

int
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/libORBit-2.so.0
#1  0x405c486a in do_corba_setup () from /usr/lib/libbonobo-2.so.0
#2  0x407c843b in g_type_create_instance () from 
/usr/lib/libgobject-2.0.so.0
#3  0x407b264f in g_object_constructor () from 
/usr/lib/libgobject-2.0.so.0
#4  0x407b1e5e in g_object_newv () from /usr/lib/libgobject-2.0.so.0
#5  0x407b261f in g_object_new_valist () from /usr/lib/libgobject-2.0.so.0
#6  0x407b1c16 in g_object_new () from /usr/lib/libgobject-2.0.so.0
#7  0x0804949a in main (argc=1, argv=0xbffff8f4) at test.c:51
#8  0x420158d4 in __libc_start_main () from /lib/i686/libc.so.6

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

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 
   creation

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,
Thomas

 -- 

The Dave/Dina Project : future TV today ! - http://davedina.apestaart.org/
<-*- 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 ! - http://urgent.rug.ac.be/




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