Hey JooJaa. Thanks for replying again. I am sorry, but I am not too sure what you mean. I think I kind of understand what you ... When working in mel global and local declarations make a big difference. I am not sure how you mean this in python.
My script is in python and what I am stuck with is that the "command" attribute of a dynamically generated button, that does not recognize the function call. I am pretty sure it is a mistake somewhere on my code... but can't seem to find it. I don't get errors, or warnings. I press the button and nothing happens...
I have a feeling that the sayHi() function has not died by the time I call it. Other functions before and after it execute fine. I have other buttons that call other functions and they are active. Furthermore, if I call sayHi from one of these explicit buttons, sayHi executes. The problem is the dynamic buttons...
The way I am executing the script is by simply highlighting the code and pressing ctrl+enter in the script editor (for now).
My previous post has an example of what I am doing. You can see that the defined function "dynaPushed" is not unloaded or disconnected from the UI. When I press any of the buttons the function prints a message; albite the wrong argument is shown, which is one of the problems I am attempting to tackle. My script has the same structure as the sample code above, yet the function is not called at all. I am positive I am doing something wrong here, I just have a hard time seeing it.
I appreciate your help... maybe if you cut and paste my code above and execute it in a python pane you can see what I am running into. The same code in a larger script that also has dynamic buttons ignores the function call all together; even though it respects the same structure, and as indicated, other buttons with hardwired command calls work.
If I am to point out differences between the explicit buttons and the dynamic buttons on my UI they are that the explicit ones are declared at the formLayout level and position via attachForm and attachControl edits of the form layout; while the dynamic buttons are generated within rowColumnLayout of the UI... I don't think this would make a diference, but will find out soon by streamlining the whole script.
My script is rather large, but I will try to simplify it and post it to give people a better idea of the problem.
Again, I appreciate your help and advice. Please keep them coming.
Jim