janusz wrote:I just wanted to know if anybody could help me sort out the following issue:
how do you make your module keep its preferences for each layer?
Cheers
Unfortunately, this is something that is not very easy. The next release of Modul8 (V2.5) will support automatic contextual layer modules which will solve your problem (a simple click in a checkbox).
Now, in the current release, you have to do it yourself.
Basically you need to:
- Track layer focus changes (using a feedback script)
- Update the module user-interface each time the focus does change
- Keep a copy of your data for each active layer (best is to store it in the per-module / per-layer dictionary that you can get using the"direct_layer_moduleDict" keyword)
- Apply your script for each active layers
Check the BMP module which does exactly that.
Yves.