Date: Fri, 10 Dec 2004 02:19:27 +0100 (CET) Message-Id: <20041210.021927.115903890.oandrieu at nerim.net> To: pascal.brisset at enac.fr Cc: lablgtk at kaba.or.jp Subject: Re: Mouse wheel event in a canvas ? From: Olivier Andrieu In-Reply-To: <41B88D74.8020707 at recherche.enac.fr> References: <41B88D74.8020707 at recherche.enac.fr> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi, > Pascal Brisset [Thu, 09 Dec 2004]: > How is it possible to handle mouse wheel events in Canvas ? I was > expecting to get a button_press 4 (or 5) event but I cannot observe > it. There's a specific scroll-event signal but apparently it's not wrapped in so you'll have to use the generic event signal. Something like this (not tested): canvas#event#connect#any (fun ev -> match GdkEvent.get_type ev with | `SCROLL -> your_fun (GdkEvent.Scroll.cast ev) | _ -> false) where your_fun has type GdkEvent.Scroll.t -> bool -- Olivier