ruby-gnome: Error when using the method Gdk::Event#motion.

@kou,

I am working on the event_axes.c demo. I have the following : An event box which catch a lot of events. In the block used when a “event” signal is send, there is the function update_axes_event(event) which crash when I try event.motion with the following message:

/home/cedlemo/.gem/ruby/2.4.0/gems/gobject-introspection-3.1.2/lib/gobject-introspection/loader.rb:248:in `get_field_value': failed to get field value: motion[interface]
	 from /home/cedlemo/.gem/ruby/2.4.0/gems/gobject-introspection-3.1.2/lib/gobject-introspection/loader.rb:248:in `block in load_field'
	 from /home/cedlemo/Projets/Ruby/ruby-gnome2/gtk3/sample/gtk-demo/event_axes.rb:299:in `update_axes_from_event'
	 from /home/cedlemo/Projets/Ruby/ruby-gnome2/gtk3/sample/gtk-demo/event_axes.rb:65:in `block in initialize'
	 from /home/cedlemo/.gem/ruby/2.4.0/gems/gobject-introspection-3.1.2/lib/gobject-introspection/loader.rb:530:in `invoke'
	 from /home/cedlemo/.gem/ruby/2.4.0/gems/gobject-introspection-3.1.2/lib/gobject-introspection/loader.rb:530:in `block in define_method'
	 from ./main.rb:501:in `<main>'

Here is the interesting part of the ruby code :


    box = Gtk::EventBox.new
    @window.add(box)
    box.support_multidevice = true
    box.add_events([:pointer_motion_mask, :button_press_mask,
                   :button_release_mask, :smooth_scroll_mask,
                   :enter_notify_mask, :leave_notify_mask,
                   :touch_mask])

    @event_data = EventData.new({}, {})

    box.signal_connect "event" do |widget, event|
      update_axes_from_event(event)
      widget.queue_draw
      false
    end

Tell me if you want to see the full script.

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 15 (15 by maintainers)

Most upvoted comments

Yes. LD_LIBRARY_PATH and GI_TYPELIB_PATH environment variables will help you.

I’m using the following:

% LD_LIBRARY_PATH=/tmp/local/lib GI_TYPELIB_PATH=/tmp/local/lib/girepository-1.0 ruby ...

The above command line is for GDK configured with --prefix=/tmp/local.