Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Created May 20, 2014 19:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/aa4f27aa135bc59bc792 to your computer and use it in GitHub Desktop.
Save anonymous/aa4f27aa135bc59bc792 to your computer and use it in GitHub Desktop.
require 'gtk3'
require 'RMagick'
require 'open-uri'
class RubyApp < Gtk::Window
def initialize
super
set_title "Privat"
signal_connect "destroy" do
Gtk.main_quit end
set_default_size 300, 200
set_window_position Gtk::Window::Position::CENTER
image = Magick::ImageList.new
urlimage = open("http://rmagick.rubyforge.org/framed_clown.jpg")
image.from_blob(urlimage.read)
posh = Gdk::Pixbuf.new :data => image.to_blob
gtkimage = Gtk::Image.new :pixbuf => posh
add gtkimage
show_all
end
end
Gtk.init
window = RubyApp.new
Gtk.main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment