[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Regions and Shells - Oh My!

Hi There,

I asked a couple questions on IRC and didn't get any immediate answers so I figured I would ask here as well.

I have a transparent shell - for simplicity lets say it is donut-shaped. Sometime later I decide I want to draw in the transparent middle. I have been able to do this by getting the Region from the shell, adding to it, and setting the new Region onto the shell, but I am unsure if this is the correct way to do this. I need to be very careful about leaking Regions. Is this the correct solution, or can I add a new sub-shell to the original and draw into the transparent areas? I'm assuming that a sub-shell won't be able to draw onto the transparent regions of the parent.

Second, perhaps not as difficult a question - if I call shell.setRegion(someRegion), will "someRegion" get disposed if I call shell.dispose(), or do I need to explicitly dispose the Region? I am thinking I need to dispose it.

The reason I ask is because I want to dynamically draw things onto the transparent areas of a background (little animations), and I need to constantly calculate a new Region for the shell. It seems dangerous to me, but if this is the only option - well I guess I'll just have to be careful about it.

Thanks in advance,
Mark.