Uwe Grauer wrote: > I already noticed, that i could call self.Form.cancel() which does the > trick, but what about the 'CancelButton = True' thing?
Well, you have a few problems. First, the only thing CancelButton does is map pressing Esc to pushing the button. You still have to write code inside the button's onHit method to have it do what you want to do, in your case calling self.Form.cancel().
Next, I'm not sure why you are getting an AttributeError setting the CancelButton property. Here is a standalone test. Please let me know if it works:
#-- import dabo
app = dabo.dApp(MainFormClass=None) app.setup()
def onCancelButton(evt): print "Cancel"
frm = dabo.ui.dForm() btn = frm.addObject(dabo.ui.dButton, CancelButton=True, Caption="Cancel") btn.bindEvent(dabo.dEvents.Hit, onCancelButton) frm.show() app.start() #--
Next, on Ubuntu at least, pressing Esc doesn't fire the button's Hit event like it should. This I'll add to the tracker as it is a Dabo issue.
-- pkm ~ http://paulmcnett.com
©2006 Paul McNett |