Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] How to get Display instance

Hi All,
I am developing a lib that can change widgets look-and-feel dynamically.
All customized widgets implement a XYZListener interface defined by me and implement the method updateStyle(). In updateStyle(), custome-widgets call redraw() to redraw themselves.
Then, I have to make sure to call all updateStyle() in UI Thread.
In order to take advantage of UI Thread from another thread, I have to use Display#asyncExec() or Display#syncExec(). The problem is how to get a Display instance. My lib has nothing to do with UI. Can I just call Display.getDefault() to get the Display instance of the application?

Thanks & Regards,
Cheng Mo



Back to the top