From: cedlemo <ce...@gm...> - 2015-11-03 11:05:53
|
I think that the example I gave you is more simple and better to start with: https://github.com/ruby-gnome2/ruby-gnome2/blob/master/vte3/lib/vte3.rb Just change the Vte name with Gnumeric: require "gobject-introspection" require "gtk3" base_dir = Pathname.new(__FILE__).dirname.dirname.expand_path vendor_dir = base_dir + "vendor" + "local" vendor_bin_dir = vendor_dir + "bin" GLib.prepend_dll_path(vendor_bin_dir) vendor_girepository_dir = vendor_dir + "lib" + "girepository-1.0" GObjectIntrospection.prepend_typelib_path(vendor_girepository_dir) # You don't nedd this #require "vte3/loader" module Vte LOG_DOMAIN = "Vte" GLib::Log.set_log_domain(LOG_DOMAIN) class Error < StandardError end class << self def const_missing(name) init if const_defined?(name) const_get(name) else super end end def init class << self remove_method(:init) remove_method(:const_missing) end Gtk.init if Gtk.respond_to?(:init) loader = Loader.new(self) loader.load("Vte") end end end This is the most basic example. Regards. On 03/11/2015 11:10, Michael Uplawski wrote: > Howdy. > > I have been a bit worried to put my question on the list, but your > responses keep me interested in GObject-Introspection. > > On Tue, Nov 03, 2015 at 09:33:54AM +0000, jc...@gm... wrote: > >> Hi, like cedlemo I'm not much of an expert, but I have made a binding >> for my own gobject-based library here: >> >> https://github.com/jcupitt/ruby-vips8 >> >> I used the binding for gst as a model, it's pretty simple to understand: >> >> https://github.com/ruby-gnome2/ruby-gnome2/blob/master/gstreamer/lib/gst.rb > You subclass a Loader and I have the immediate feeling, that this must > be crucial for all that follows. I do not have to understand all the > meta-programming which is anyway out of my reach to see clearer now. > > Thank you very much. > > Michael > >> Just copy-paste that and change the names to refer to the gnumeric >> objects instead and it should work. >> >> The gst binding does some extra renaming and overriding to make the >> interface pleasant to use, you probably won't need that, at least to >> start with. >> >> John >> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> ruby-gnome2-devel-en mailing list >> rub...@li... >> https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en > > > ------------------------------------------------------------------------------ > > > _______________________________________________ > ruby-gnome2-devel-en mailing list > rub...@li... > https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en |