Le 20 mars 2012 14:54, Nikolai Weibull <now@bitwi.se> a écrit :
The following Gtk::Entry never gets Gdk::Event::BUTTON2_PRESS:

class A < Gtk::Entry
 def initialize
   super
   add_events Gdk::Event::BUTTON_PRESS_MASK
   signal_connect 'button_press_event' do |widget, event|
     select_range 0, -1 if event.event_type ==
Gdk::Event::BUTTON2_PRESS and event.button == 1
     false
   end
 end
end

What am I doing wrong?

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
ruby-gnome2-devel-en mailing list
ruby-gnome2-devel-en@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en


Hi

I tried

signal_connect 'button_press_event' do |widget, event|
p "ok" if Gdk::Event::Type::BUTTON2_PRESS==event.event_type
false
end

and it works.

--
Vincent Carmona