Date: Mon, 16 May 2005 23:50:25 +0200 (CEST) Message-Id: <20050516.235025.41633013.oandrieu at nerim.net> To: robertr at rftp.com Cc: lablgtk at math.nagoya-u.ac.jp Subject: Re: Using file_chooser_dialog From: Olivier Andrieu In-Reply-To: <20050515.164341.59467888.oandrieu at nerim.net> References: <20050512.152208.88493160.andrieu at ijm.jussieu.fr> <4285720D.9020706@rftp.com> <20050515.164341.59467888.oandrieu@nerim.net> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit > Olivier Andrieu [Sun, 15 May 2005]: > > Robert Roessler [Fri, 13 May 2005]: > > Olivier Andrieu wrote: > > > > > Robert Roessler [Tue, 10 May 2005]: > > > > 2) how can I connect the dialog's Cancel button to the Escape key on > > > > the keyboard? > > > > > As for 2), it may be intended. There was some debate on some ML at one > > > time about NOT having the cancel button close the dialogs, for UI > > > reasons. > > > > Sigh - NOT having the Esc key be equivalent to the Cancel button in > > dialogs drives me crazy. :) > > OK it seems that for dialogs (at least the file chooser one), GTK+ > does connect esc to close, I'm not sure why this doesn't work in > lablgtk. I'll look into it. This is another case where dialogs that use predefined response ids (here GTK_RESPONSE_CANCEL) get some special behavior. Lablgtk automatically assign ids to the added buttons so we don't benefit from this. Anyway, all you have to do is to connect the "close" signal of the dialog : dialog#connect#close (fun () -> dialog#response `CANCEL) (substitute `CANCEL for whatever id you use to mean 'close the dialog and abort'). -- Olivier