Re: Example for integrating gtkhtml into a gtkmm application



On 2006-02-12 (Sunday), at 21:57:33 Tobias Eberle wrote:

> Hallo,
> 
> does anyone have a simple example about how to integrate gtkhtml into a
> gtkmm application?
first You have include gtkhtml headers
extern "C" {
#include <gtkhtml/gtkhtml.h>
}

then you can use it normally:

GtkWidget *c_html = gtk_html_new();
gtk_html_load_from_string(GTK_HTML(c_html), "<h1>Simple example</h1><br/>is
simple that <b>simple</b> enough?", -1);

gtk_widget_show(c_html);

To make gtkmm Widget from it you can do this:

Gtk::Widget *html_widget = Glib::wrap(c_html);

and if you have some Gtk::Window named my_window you can add it in this way:
my_window->add(*html_widget);

and so on...

besides using Glib::wrap you can do everything as described in gtkhtml
documentation.



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