Gtkhtml2 blank window

hi ho ml :-),

i run into a new problem while writing an gtk application. a lot of
things are working now, but not the gtkhtml2. i tried to put some html
code into the html-document, but i get an blank window only.

i’ve written a working (or better: not working) example. everyone with
an idea is really welcome :-). any suggestion for tutorials, examples or
documentation is also very welcome - google wasn’t really useful. i
found an example on http://koti.welho.com/jpakaste/blog/2002/index.html

thanks,
patrick

ps. sorry for my tripple sending of my last mail, i had trouble with the
email server

require ‘gtk2’
require ‘gtkhtml2’

Gtk::init

window = Gtk::Window.new
window.border_width = 10
window.set_size_request(600, 400)
window.add(box = Gtk::VBox.new(false, 0))

htmlview = Gtk::HtmlView.new()
document = Gtk::HtmlDocument.new()
document.clear
document.open_stream(“text/html”)
document.write_stream(“titlebody”)
document.close_stream()

window.signal_connect(‘delete_event’) do
Gtk::main_quit
false
end

box.pack_start(htmlview)
window.show_all
Gtk::main

Patrick,

I may be missing something, but it looks like you never add htmlview to
your window, or the vertical box that you’ve created.

-trevor

Patrick,

I was indeed missing something. That’ll teach me to reply before I
finish
reading code :slight_smile:

-trevor

Patrick,

I read into it, and it looks like you never connect htmlview and
document.
If you add this somewhere after document is created, I would think it
would help… I’m not sure of the syntax on this one, given that the
article you referenced seems to do things just slightly differently. I
assumed the underscore, just because it’s Ruby, but I could be wrong…

htmlview.set_document(document)

I even read through all the code this time, and feel that this is a
valid
suggestion :slight_smile:

Hope this works!

-trevor

Trevor Elliott wrote:

Patrick,

I was indeed missing something. That’ll teach me to reply before I finish
reading code :slight_smile:

maybe i should begin with the signal handler next time this could make
the code easier to read.

greetings,
patrick

Trevor Elliott schrieb:

I even read through all the code this time, and feel that this is a valid
suggestion :slight_smile:

yes, that’s it! thanks :-). it works fine now, i just forgot to connect
the document. the following both lines do the same thing (just for the
archive):

htmlview.set_document(document)
htmlview.document = document

thanks again and if you will be in germany one time, i’ll get you a
coffee or a tea if you wish :slight_smile:

patrick