I have a queue and based on its contents I create image controls at runtime. So if I have 5 records in the queue, I use CREATE() to put 5 image controls on the window. This works.
But I want these images to become ActiveImages because I need to get mousedown events when user clicks on any of these images.
I’ve manually added INCLUDE(‘ActiveImage.inc’),once in global embeds, I’ve declared:
img1 ActiveImage in data of the window
Now here’s the problem. If I put an image control in designer onto the window and call img1.init(window,?image1,0,0) anywhere in ThisWindow.Init embed, it works.
So for some reason INIT has to be rather early in the process. But the trick is I’m not putting image controls in designer, I’m creating them at runtime. And calling img1.init after CREATE() sometime later on does not work, meaning mousedown is not reported as event. Sort of chicken-egg issue.
Any idea how can I make this work? Create image controls at runtime and catch an event when users clicks on any of them (of course I need to know on which control the user has clicked so I can act properly later on). If this can be done without using activeimage, no problem. I just need events fired when users clicks on those images.
Thanks for the help
Bostjan