Re: [Java-gnome-developer] Grabbing default in a subclass of Dialog
Brought to you by:
afcowie
From: Andrew C. <an...@op...> - 2010-08-11 00:31:37
|
On Tue, 2010-08-10 at 10:15 +0100, Richard Senior wrote: > applyButton.setCanDefault(true); > applyButton.grabDefault(); > > But when I show the dialog and press return, the default button isn't > activated > Am I missing something? No and yes. I just tried it with some very similar code that I have, and discovered that likewise calling Widget's grabDefault() doesn't do it. Damn. I poked around in the GTK docs, and it turns out there is a method gtk_dialog_set_default_response(). Which works. You have to call setCanDefault() on your custom Button first, though. I've added coverage for setDefaultReponse() to Dialog, and merged it to 'mainline'. It'll be in java-gnome 4.0.17 AfC Sydney |