To: stalkern2 at tin.it Cc: lablgtk at kaba.or.jp Subject: Re: How to retrieve a widget by its ID? the result of get_id of a widget In-Reply-To: <200308151357.37112.stalkern2 at tin.it> References: <200308151357.37112.stalkern2 at tin.it> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20030816145118M.garrigue at kurims.kyoto-u.ac.jp> Date: Sat, 16 Aug 2003 14:51:18 +0900 From: Jacques Garrigue Lines: 18 From: Stalkern 2 > I've noticed that several widgets offer a method > get_id > that returns their unique ID. > > But how do I retrieve a widget by its unique ID? I can't find this > anywhere in the GTK documentation. This ID is only the physical pointer to the widget, with its lower bit set to 1, for it to be recognized as an ocaml integer. The only goal is to make easier building indexed datastructures containing widgets, or printing debugging information. If you want to be able to do something with a widget, you must keep the result of the #as_widget method. Then the Gtk*..cast functions will let you dynamically cast it back to its actual class. Jacques