To: c_bauer at informatik.uni-kl.de Cc: lablgtk at kaba.or.jp Subject: Re: button_press events in drawing_area In-Reply-To: References: Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20030516162630S.garrigue at kurims.kyoto-u.ac.jp> Date: Fri, 16 May 2003 16:26:30 +0900 From: Jacques Garrigue Lines: 18 From: Christoph Bauer > my application (lablgtk2) doesn't get a button_press event. > > (It draws a chess board on the drawing_area. Then I want to move the > pieces.) So I added a simple test to determine how to catch the events. > > ignore( area#event#connect#button_press ~callback:(fun key -> print_string "bing"; print_newline (); true)) > > But my callback routine isn't called. It is a traditional quirk of Gtk: you must declare what events you want to get, outside of default ones. I suppose than a drawing area doesn't get button press events by default. area#event#add [`BUTTON_PRESS] Jacques