events in customdialog

Thomas Liebeskind <[email protected]> Tue, 16 Mar 2010 14:05:10 +0100
Newsgroups gmane.comp.python.pythoncard
Message-ID <[email protected]>
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

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev

_______________________________________________
Pythoncard-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pythoncard-users