Re: nautilus view hacking



On Sat, 2002-10-26 at 12:35, Thomas Vander Stichele wrote:
<snip>
> 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.

Try "export BONOBO_ACTIVATION_DEBUG_OUTPUT=1" and "export
BONOBO_ACTIVATION_DEBUG_EXERUN=1".  Also, see
libbonobo/docs/debugging.txt.

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

Ok, for an out-of-proc nautilus view (like the one you're writing), this
should be possible.  In order to have an accurate test, though, you need
to actually query for the component, embed, etc...similar to what
nautilus will do.  I think the following snippet is approximately what
you need (note:  I am new to this too, so it may not be perfect):

	Bonobo_Unknown obj;
	Nautilus_View view;
	Bonobo_Control control;
	GtkWidget *widget;

	obj = bonobo_activation_activate_from_id
			("OAFIID:Nautilus_Test_View", 0, NULL, NULL);
	
	view = Bonobo_queryInterface (obj, "IDL:Nautilus/View:1.0",
				      NULL);
	Nautilus_View_load_location (view, uri, NULL);

	control = Bonobo_queryInterface (obj, "IDL:Bonobo/Control:1.0",
					 NULL);
	widget = bonobo_widget_new_control_from_objref (control,
							CORBA_OBJECT_NIL);

	/* pack the widget into a window, or whatever */
	...

Also, I think you will have to have bonobo_init() and bonobo_main()
instead of the gtk equivalents.

Thanks,
James




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