[Gtk-sharp-list] HTML Object as Container

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


I'm trying to Write an Application with the Layout in HTML.

However i don't get my widget into the HTML Object.

I have the following code:


--------------------------------------------------------------------------
using System;
using System.IO;
using Gtk;

class Silberchat{
	Window win;
	HTML design;

	Silberchat(){
		Console.WriteLine("Start");
		win=new Window("Silberchat");
		design=new HTML( File.OpenText("Silberchat.UI").ReadToEnd() );
		win.Add(design);
		win.DeleteEvent += new DeleteEventHandler(Window_Delete);

		design.ObjectRequested += new ObjectRequestedHandler(
			ObjectRequested );

		design.ShowAll();

		win.ShowAll();
	}

	void Window_Delete ( object obj, DeleteEventArgs args ) {
		win.Destroy();
		Application.Quit();
		args.RetVal = true;
	}

	public static void Main(){
		Application.Init();
		new Silberchat();
		Application.Run();
	}

	void ObjectRequested( object o, ObjectRequestedArgs args ){
		HTMLEmbedded he;
		Container cont;
		Widget wid;
		
		he=args.Arg2;
		
		Console.WriteLine("Object_Request");
		
		wid=new Button("Test");

		cont=new Container( he.Handle );
		cont.Add(wid);

		wid.Show();
		cont.Show();

		this.win.ShowAll();
	}
}
--------------------------------------------------------------------------

In the file Silberchat.UI:
--------------------------------------------------------------------------
<table width="100%">
	<tr>
		<td align="left">left</td>
		<td align="right">right
		<object classid="test">
		</object></td>
	</tr>
</table>
--------------------------------------------------------------------------


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?

Marc