From: Thomas L. <tho...@go...> - 2010-03-16 13:05:21
|
Hi, following problem: I have a background calling a custom dialog via *automate_gui.automateDlg(self, self.script)* *#script = just some text * where automateDlg is the function creating the dialog: *from PythonCard import model class AutomateDlg(model.CustomDialog): def __init__(self, parent): * * model.CustomDialog.__init__(self, parent) * * * * def on_initialize(self, event):* * print 'init' * * def on_save_mouseClick(self, event):* * print 'save'* * * * def on_load_mouseClick(self, event):* * print 'load' * * def on_close(self, event):* * print 'close' * * def on_mouseUp(self, event):* * print 'up' * * def on_script_textUpdate(self, update):* * print 'script'* * def automateDlg(parent, init): dlg = AutomateDlg(parent) dlg.components.script.text = init result = dlg.showModal() result.script = None if(result.accepted): result.script = dlg.components.script.text dlg.destroy() return result * * *the dialog has been created with PythonCard LayoutEditor: *{'type':'CustomDialog',* * 'name':'AutomateDlg',* * 'title':'Automate',* * 'position':(240, 129),* * 'size':(410, 400),* * 'components': [* * * *{'type':'Button',* * 'name':'load',* * 'position':(85, 346),* * 'label':'Load',* * },* * * *{'type':'Button',* * 'name':'save',* * 'position':(5, 346),* * 'label':'Save',* * },* * * *{'type':'TextArea',* * 'name':'script',* * 'position':(5, 3),* * 'size':(391, 338),* * },* * * *{'type':'Button',* * 'id':5100,* * 'name':'ok',* * 'position':(321, 346),* * 'default':1,* * 'label':'OK',* * },* * * *{'type':'Button',* * 'id':5101,* * 'name':'cancel',* * 'position':(242, 346),* * 'label':'Cancel',* * },* * * *] # end components* *} # end CustomDialog* the problem ist, that NONE ofe the events is beeing triggered. I need the 2 extra buttons (save and load) to handle file load/save routines, but none triggers. What did I do wrong? (please ignore ident errors due to copy/paste issues) Thnks and best regards Thomas Liebeskind |