radixk
asked on
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?
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?
ASKER
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.
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: https://www.experts-exchange.com/Community_Support/
And request a thread deletion and refund of points :)
best of luck for the future
[r.D]
Go here: https://www.experts-exchange.com/Community_Support/
And request a thread deletion and refund of points :)
best of luck for the future
[r.D]
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
gL,
[r.D]