[Gtk-sharp-list] HTML Object as Container

Marc Lucks n1LWeb@web.de
Mon, 7 Jun 2004 22:00:52 +0200


On Sun, 6 Jun 2004 12:57:35 +0200
Marc Lucks <n1LWeb@web.de> wrote:

> 
> I'm trying to Write an Application with the Layout in HTML.
> 
> However i don't get my widget into the HTML Object.
> 
[...]
> 
> The ObjectRequested function doesn't get called. Object_Request doesn't show.
> 
> Can someone  tell me what I'm doing wrong, or show me an application
> that does the Layout over Gtk.HTML so that i can look how it's done?

Okay, I figured out why the ObjectRequested function didn't get called. The
Page was loaded and rendered before I added the Signal Handlers.

However now my application Crashes:

Code:
-----
	static void Object_Requested( object o, ObjectRequestedArgs args ){
		HTMLEmbedded he;
		Widget wid;

		Console.WriteLine("Object_Request");

		he=args.Arg2;
		
		wid=new Button("Test");

		he.Add(wid);

		wid.Show();
	}

Error:
------
Object_Request

Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidCastException: Cannot cast from source type to destination type.
in <0x0003a> Gtk.ObjectRequestedArgs:get_Arg2 ()
in <0x0002c> Silberchat:Object_Requested (object,Gtk.ObjectRequestedArgs)
in (unmanaged) /usr/lib/libmono.so.0 [0x400821b3]
in (unmanaged) /usr/lib/libmono.so.0(mono_runtime_invoke+0x35) [0x400ce725]
.......

Monodoc tells me that Arg2 is HTMLEmbedded

What am I doing wrong?

Marc