hitchhiker's guide, ruby mozembed

“Space is big. You just won’t believe how vastly, hugely, mind- bogglingly big it is. I mean, you may think it’s a long way down the road to the chemist’s, but that’s just peanuts to space.”

i finally got around to reading the hitchhiker’s guide to the galaxy. really funny book. maybe i will try to read the other books at some point.

i played around some today with ruby-gnome2 bindings. all i can say is wow. the website documentation is incredible, and you can do so much in so little code. i played around some with ruby-gtkmozembed, and in a few lines of code, you basically have a fully functional web browser.

require 'gtkmozembed'

class Main
   def initialize
      Gtk.init
      window = Gtk::Window.new
      window.resize(800, 600)
      window.title = "ahmed's google test"

      browser = Gtk::MozEmbed.new
      browser.chrome_mask = Gtk::MozEmbed::ALLCHROME
      browser.location = "http://www.google.com"
      browser.signal_connect("title"){ window.title = browser.title; }

      window << browser
      window.show_all
      window.signal_connect("destroy"){ Gtk::main_quit }
   end
end

Main.new
Gtk.main

that’s all for now.

comments powered by Disqus