In-Reply-To: <16306.21520.114875.995598 at akasha.ijm.jussieu.fr> References: <16306.4493.522709.269560 at akasha.ijm.jussieu.fr> <20031112110126.GA24987@cs.unibo.it> <16306.21520.114875.995598@akasha.ijm.jussieu.fr> Subject: Re: GTree row selection event To: andrieu at ijm.jussieu.fr Cc: lablgtk at kaba.or.jp Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20031113090754N.garrigue at kurims.kyoto-u.ac.jp> Date: Thu, 13 Nov 2003 09:07:54 +0900 From: Jacques Garrigue Lines: 27 From: Olivier Andrieu > Claudio Sacerdoti Coen [Wednesday 12 November 2003] : > > Anyway, since a couple of students of mine already asked me how to > > obtain an event_ops from a generic widget, I think that this function > > should be inserted in lablgtk2 (with type -> > > event_ops). > > Or we could simply put the event method in the base widget class, with > or without the NO_WINDOW flag check ; it's never an error to connect > these event-related signals, they are just never called if the widget > doesn't have a GdkWindow. The goal of the #event sub-object is to be able to tell from its type whether a widget handles events or not. If a widget is able to handle events and has no #event method, this is a bug of lablgtk and should be corrected. The dynamic approach is also possible, but means that you will only know whether a widget handles events or not at runtime. Religious problem. No check at all is a bad idea: your program compiles, but you callback is never called, and you don't know why. (Whether a widget handles events or not is not very explicit in the Gtk2 documentation) Jacques