えすとも(佐藤寛和)です。はじめまして。

Gdk::EventButtonのx_rootを取得しようとしたらSegmentation fault食らいま
した。

require 'gtk'

window = Gtk::Window::new
window .show
window .add_events(Gdk::BUTTON_PRESS_MASK)
window .signal_connect("button_press_event") do |window, event|
  p(event .x_root)
end

Gtk::main

--
s-tomo Email satou / rd.mmtr.or.jp
       WWW   http://www2.willy.co.jp/~s-tomo/

--- rbgdkevent.c 2000/08/07 16:24:54 1.1.1.1 +++ rbgdkevent.c 2000/08/11 08:41:39 @@ -86,63 +86,63 @@ gdkeventmotion_x(self) VALUE self; { - return INT2NUM(get_gdkevent(self)->motion.x); + return rb_float_new(get_gdkevent(self)->motion.x); } static VALUE gdkeventmotion_y(self) VALUE self; { - return INT2NUM(get_gdkevent(self)->motion.y); + return rb_float_new(get_gdkevent(self)->motion.y); } static VALUE gdkeventmotion_pressure(self) VALUE self; { - return NUM2DBL(get_gdkevent(self)->motion.pressure); + return rb_float_new(get_gdkevent(self)->motion.pressure); } static VALUE gdkeventmotion_xtilt(self) VALUE self; { - return NUM2DBL(get_gdkevent(self)->motion.xtilt); + return rb_float_new(get_gdkevent(self)->motion.xtilt); } static VALUE gdkeventmotion_ytilt(self) VALUE self; { - return NUM2DBL(get_gdkevent(self)->motion.ytilt); + return rb_float_new(get_gdkevent(self)->motion.ytilt); } static VALUE gdkeventmotion_source(self) VALUE self; { - return NUM2INT(get_gdkevent(self)->motion.source); + return INT2NUM(get_gdkevent(self)->motion.source); } static VALUE gdkeventmotion_deviceid(self) VALUE self; { - return NUM2INT(get_gdkevent(self)->motion.deviceid); + return INT2NUM(get_gdkevent(self)->motion.deviceid); } static VALUE gdkeventmotion_x_root(self) VALUE self; { - return NUM2DBL(get_gdkevent(self)->motion.x_root); + return rb_float_new(get_gdkevent(self)->motion.x_root); } static VALUE gdkeventmotion_y_root(self) VALUE self; { - return NUM2DBL(get_gdkevent(self)->motion.y_root); + return rb_float_new(get_gdkevent(self)->motion.y_root); } static VALUE @@ -171,35 +171,35 @@ gdkeventbutton_x(self) VALUE self; { - return INT2NUM(get_gdkevent(self)->button.x); + return rb_float_new(get_gdkevent(self)->button.x); } static VALUE gdkeventbutton_y(self) VALUE self; { - return INT2NUM(get_gdkevent(self)->button.y); + return rb_float_new(get_gdkevent(self)->button.y); } static VALUE gdkeventbutton_pressure(self) VALUE self; { - return NUM2DBL(get_gdkevent(self)->button.pressure); + return rb_float_new(get_gdkevent(self)->button.pressure); } static VALUE gdkeventbutton_xtilt(self) VALUE self; { - return NUM2DBL(get_gdkevent(self)->button.xtilt); + return rb_float_new(get_gdkevent(self)->button.xtilt); } static VALUE gdkeventbutton_ytilt(self) VALUE self; { - return NUM2DBL(get_gdkevent(self)->button.ytilt); + return rb_float_new(get_gdkevent(self)->button.ytilt); } static VALUE @@ -227,21 +227,21 @@ gdkeventbutton_deviceid(self) VALUE self; { - return NUM2INT(get_gdkevent(self)->button.deviceid); + return INT2NUM(get_gdkevent(self)->button.deviceid); } static VALUE gdkeventbutton_x_root(self) VALUE self; { - return NUM2DBL(get_gdkevent(self)->button.x_root); + return rb_float_new(get_gdkevent(self)->button.x_root); } static VALUE gdkeventbutton_y_root(self) VALUE self; { - return NUM2DBL(get_gdkevent(self)->button.y_root); + return rb_float_new(get_gdkevent(self)->button.y_root); } /* GdkEventKey */ @@ -292,7 +292,7 @@ gdkeventcrossing_detail(self) VALUE self; { - return NUM2INT(get_gdkevent(self)->crossing.detail); + return INT2NUM(get_gdkevent(self)->crossing.detail); } /* GdkEventFocus */
x_root以外は未確認です。