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("<html><head><title>title</title></head><body>body</body></html>")
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
···
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("<html><head><title>title</title></head><body>body</body></html>")
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 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 
Hope this works!
-trevor
···
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("<html><head><title>title</title></head><body>body</body></html>")
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 was indeed missing something. That'll teach me to reply before I finish
reading code 
-trevor
···
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
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("<html><head><title>title</title></head><body>body</body></html>")
document.close_stream()
window.signal_connect('delete_event') do
Gtk::main_quit
false
end
box.pack_start(htmlview)
window.show_all
Gtk::main
Trevor Elliott schrieb:
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 
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 
patrick
Trevor Elliott wrote:
Patrick,
I was indeed missing something. That'll teach me to reply before I finish
reading code 
maybe i should begin with the signal handler next time this could make the code easier to read.
greetings,
patrick