From: Olivier Andrieu MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16331.8738.199661.466059 at akasha.ijm.jussieu.fr> Date: Mon, 1 Dec 2003 12:12:34 +0100 To: Jacques Garrigue , Claudio Sacerdoti Coen Cc: lablgtk at kaba.or.jp Subject: Re: GTree row selection event In-Reply-To: <16306.4493.522709.269560 at akasha.ijm.jussieu.fr> References: <20031107100532.GA17659 at cs.unibo.it> <20031110104118V.garrigue@kurims.kyoto-u.ac.jp> <20031110105058.GA19281@cs.unibo.it> <16306.4493.522709.269560@akasha.ijm.jussieu.fr> Olivier Andrieu [Wednesday 12 November 2003] : > It quite easy to construct an event_ops object even if the widget > class does not provide an #event method : > > let make_event w = > if w#misc#get_flag `NO_WINDOW > then failwith "widget cannot receive events" > else new GObj.event_ops w#as_widget > > This function checks whether the widget has an associated GdkWindow > (IIRC it's a requirement for receiving X events and event signals) and > then builds an event_ops object. Actually it is a bit more complicated than I thought and the `NO_WINDOW check is not a very good idea because : - some widgets have the `NO_WINDOW flag but trigger these event-related signals (notably GtkButton) - all widgets can receive the expose event (it is "synthesized" by the parent container) Jacques Garrigue [Thursday 13 November 2003] : > If a widget is able to handle events and has no #event method, this > is a bug of lablgtk and should be corrected. I've grep'ed a bit the GTK+ source tree and I added an #event method to the following widgets : - GtkTreeView (in GTree.view) - GtkScale (in GRange.range) - GtkRuler (in GRange.ruler) -- Olivier