From: Olivier Andrieu MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16483.63571.455639.187324 at akasha.ijm.jussieu.fr> Date: Fri, 26 Mar 2004 10:30:59 +0100 To: briand at aracnet.com Cc: lablgtk at kaba.or.jp Subject: Re: event variant types In-Reply-To: <16483.50834.898498.682875 at soggy.deldotd.com> References: <16482.33127.497203.821118 at soggy.deldotd.com> <20040325165247V.garrigue@kurims.kyoto-u.ac.jp> <16483.50834.898498.682875@soggy.deldotd.com> briand@aracnet.com [Thursday 25 March 2004] : > > >>>>> "Jacques" == Jacques Garrigue writes: > > Jacques> But I have a strange feeling that is not what you are > Jacques> actually trying to do. The point is, all events are already > Jacques> part of the GdkEvent.any type. So you don't have to wrap > Jacques> anything. If you want to distinguish some specific events, > Jacques> you can do it with > > Jacques> GdkEvent.get_type: > Jacques> match GdkEvent.get_type event with > Jacques> #GdkEvent.Button.types -> true > Jacques> | #GdkEvent.Key.types -> true > Jacques> | #GdkEvent.Motion.types -> true > Jacques> | _ -> false > Jacques> for instance. > > This is of course exactly what I am trying to do. > > File "main.ml", line 297, characters 8-27: > Unbound type constructor GdkEvent.Key.types This `types' polymorphic variant only exists for Button events apparently. Maybe it should be defined for all events kinds, for consistency. match GdkEvent.get_type event with #GdkEvent.Button.types -> true | `KEY_PRESS|`KEY_RELEASE -> true | `MOTION_NOTIFY -> true | _ -> false -- Olivier