Womb.Gtk : Womb.Gtk Namespace

Interface for widgets that can generate HTML output

public interface IHtmlizable


All widgets that implement Womb.Gtk.IHtmlizable use some css tags you can set to customize output.

Tag Description
table#womb id to use for formatting a womb-generated table
wombcell style for text within a table cell
wombcolheader style for text within a column header

Example: generate a dump from a Womb.Gtk.AtomTab with custom colours and fonts:

C# Example
	using System.Text;
	using Womb.Gtk;

	void DumpHtml (IHtmlizable widget)
		string              css_chunk;
		StringBuilder   html;

		// Construct some random css tags to customize our output
		css_chunk = ".wombcell  { font-family:Verdana,Arial,Helvetica; padding:2px; font-size:12px; color:#616161; }" +
                                    "table#womb {background-color:#FFFFFF; padding:4px; }";

		// Create a StringBuilder to assemble the html output
		html = new StringBuilder ();

		// Construct an html page by adding tags, css from our stylesheet and
		// the html output from the widget		

		html.Append ("<html><head><style>" + css_chunk + "</style></head>");
		html.Append ("<body>" + widget.ToHtml () + "</body></html>");

		Console.WriteLine (html.ToString ());
ToHtml () : string
Generate HTML output
Member Details
public string ToHtml ()

Generate HTML output

A string containing an HTML dump of the contents of the widget. The contents of the HTML are widget-specific.
Generated HTML is not self-contained, that is, it is not enclosed in <html> and </html> tags, and does not contain a header with content information. You must manually wrap the returned text yourself with whatever suits your application.