Skip to content

Instantly share code, notes, and snippets.

@penguin2716
Created September 28, 2013 09:42
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 penguin2716/6740408 to your computer and use it in GitHub Desktop.
Save penguin2716/6740408 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'gtk2'
module Gtk
class Foo < Gtk::TextView
def update_font(str)
self.modify_font(Pango::FontDescription.new(str))
end
end
end
w = Gtk::Window.new
w.set_size_request(300,200)
tv = Gtk::Foo.new
tv.update_font("Sans bold 18")
w.add(tv)
w.show_all
Gtk.main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment