SWT detecting system color changes

I have a SWT app using the CTabFolder and I am setting it's color to a gradient based on the system colors.  It works perfectly and looks great.

The problem is that when the system colors are changed after the control is created it doesn't update the CTabFolder colors.  I think I need to add a listener to the display object but I can't seem to figure out what it is I should be listening for.  Also, since the tabs are created at runtime on demand, how would I loop through them and change the colors when the listener is fired?
Who is Participating?
ee_ai_constructConnect With a Mentor Commented:
Question answered by asker or dialog valuable.
Closed, 250 points refunded.
ee_ai_construct (replacement part #xm34)
Community Support Admin
Yeah, you'll probably need to create a Thread to keep checking the system colours, and if they change, it updates the CTabFolder.

radixkAuthor Commented:
I figured this one out.

I created a Hashtable at startup and placed the current system colors in it.  I then created a paint listener in the CTabFolder and then compared the Hashtable to the current system colors.  If they're different, I set the colors and then update the hashtable with the current colors.

Works perfect.
Sounds nice ;)

Go here: www.experts-exchange.com/Community_Support/

And request a thread deletion and refund of points :)

best of luck for the future
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.