Created
September 28, 2013 09:42
-
-
Save penguin2716/6740408 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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