Skip to content

@royw /gist:156815
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
#!/usr/bin/env ruby
# demos a problem between ruby-gnome2-0.19.0 and datamapper-0.10.0 (also 0.9.11)
# basically if a datamapper model is used, then created Gtk::Window objects will
# be drawn empty (i.e., the windows are blank looking).
require 'rubygems'
require "gtk2"
require 'dm-core'
DataMapper.setup(:default, 'sqlite3::memory')
# window properly displays when USE_MODEL is false,
# the window is blank when USE_MODEL is true.
USE_MODEL = true
# USE_MODEL = false
if USE_MODEL
class Person
include DataMapper::Resource
property :id, Serial
property :name, String, :length => 80
end
# Using the model is what triggers the error
Person.auto_upgrade!
who = Person.create(:name => 'Roy')
puts Person.first.name
end
# Gtk.init
window = Gtk::Window.new
window.signal_connect('destroy') {Gtk.main_quit}
frame = Gtk::Frame.new('Content Frame')
frame.add Gtk::Label.new("Howdy")
window.add frame
window.show_all
Gtk.main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.