Re: Documentation to gtkhtml2!
- From: Todd Kulesza <todd dropline net>
- To: "Sergey V. Beloshitsky" <snowman ukrpost com ua>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: Documentation to gtkhtml2!
- Date: Fri, 08 Nov 2002 12:56:49 -0500
Here's a bit from my latest project, a cross-platform eBay auction
manager. It seems to work pretty well on Linux, and I'm trying to get
libgtkhtml to compile on Win32 so I can test it there as well. If you
have any questions, let me know.
Todd
Sergey V. Beloshitsky wrote:
Hi Todd (sorry if there is mistake in your name)
You wrote that headers helped you, but i think i am not so mature in gtk
programming to understand all of it, so it will be REALLY good if you
would like to give some of your source code( maybe simple examples ). Adn
enother question: Can i use it without ATK library, i mean using only
gtk2?
Thanks for help!
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
#include <libgtkhtml/gtkhtml.h>
/* clipped from my threaded network code, called by http_get_image */
if ((id = g_async_queue_try_pop (jc->jn->image_queue)))
{
if (id->image->data)
html_stream_write (id->stream, id->image->data, id->image->len);
g_free (id->image->data);
g_free (id->url);
g_free (id);
}
/* end clip */
void
url_requested (HtmlDocument *doc, const gchar *uri, HtmlStream *stream, gpointer data)
{
JadeClient *jc = (JadeClient *) data;
http_get_image (jc, uri, stream);
return;
}
void
dialog_build_preview (JadeClient *jc, JadeItem *ji, const gchar *html)
{
GtkWidget *view;
GtkWidget *scrolled_window;
HtmlDocument *doc;
static GtkWidget *dialog = NULL;
if (dialog)
{
gtk_window_present (GTK_WINDOW (dialog));
return;
}
dialog = gtk_dialog_new_with_buttons (
"Jade - Preview Item",
GTK_WINDOW (util_window_get (jc)),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_CLOSE, GTK_RESPONSE_REJECT,
NULL);
gtk_widget_set_size_request (dialog, 620, 440);
doc = html_document_new ();
g_signal_connect (G_OBJECT (doc), "request_url",
G_CALLBACK (url_requested), jc);
html_document_open_stream (doc, "text/html");
html_document_write_stream (doc, html, strlen (html));
html_document_close_stream (doc);
view = html_view_new ();
html_view_set_document (HTML_VIEW (view), doc);
html_view_set_magnification (HTML_VIEW (view), 1.0);
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC,
GTK_POLICY_ALWAYS);
gtk_container_add (GTK_CONTAINER (scrolled_window), view);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), scrolled_window, TRUE, TRUE, 3);
g_signal_connect (G_OBJECT (dialog), "response",
G_CALLBACK (preview_item_response), jc);
g_signal_connect (G_OBJECT (dialog), "destroy",
G_CALLBACK (gtk_widget_destroyed), &dialog);
gtk_widget_show_all (dialog);
return;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]