# GTK3, deprecated window.get\_pointer() raises exception

**URL:** <https://www.ruby-forum.com/t/gtk3-deprecated-window-get-pointer-raises-exception/238604>\
**Category:** Ruby-Gnome 2\
**Created:** [January 20, 2014, 1:06am UTC](https://www.ruby-forum.com/t/gtk3-deprecated-window-get-pointer-raises-exception/238604 "2014-01-20T01:06:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [January 20, 2014, 1:06am UTC](https://www.ruby-forum.com/t/gtk3-deprecated-window-get-pointer-raises-exception/238604/1 "2014-01-20T01:06:38Z")

</div>

Hello,

recently I tried porting an application to GTK3  
([Homepage of Dr. Stefan Salewski](http://www.ssalewski.de/PetEd.html.en))

using Ruby 2.0 and ruby-gnome2-2.1.0 shipped with Gentoo-Linux (AMD64)  
in default configuration.

Basically it works fine, I got some warnings about deprecated stuff  
which I fixed.

Unfortunately use of deprecated Gtk::Widget#pointer raised an exception.

/usr/lib64/ruby/site\_ruby/2.0.0/glib2/deprecatable.rb:136:in `block in __define_deprecated_method__': pet/peted.rb:588:in `distribute\_events’:  
‘Gtk::Widget#pointer’ has been deprecated. Use  
‘Gdk::Window#get\_device\_position’.

Following a recent discussion on GTK mailing list

[https://mail.gnome.org/archives/gtk-list/2014-January/msg00020.html](https://mail.gnome.org/archives/gtk-list/2014-January/msg00020.html)

On Fri, 2014-01-17 at 17:26 -0500, Jasper St. Pierre wrote:  
It doesn’t seem like there’s anything wrong with using the deprecated

> methods, then. File a bug with the Ruby GTK3 bindings, and continue  
> using  
> window.get\_pointer(); for now would be my suggestion.

On Fri, 2014-01-17 at 19:19 -0500, Jasper St. Pierre wrote:

> Deprecated methods should not raise an exception. Deprecated methods  
> shouldn’t stop working because they’re deprecated.

it is difficult to avoid window.get\_pointer() when keyboard input for  
CAD applications require mouse coordinates. GTK-Developers consider  
continuing using window.get\_pointer(). So it would be nice if  
Ruby-Gnome2 would not raise an exception and abort the program in  
default setup.

Best regards,

Stefan S.
