Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [platform-swt-dev] Some questions for the SWT developers

4) Why is there no addNotify method for the SWT widgets? (I'm using it to
extend the Swing widgets with necessary extensions.)


        I will leave this question to one of the other members of the team. 

I'm not one of the team members, but I can answer it.
 
addNotify() is used by AWT to create its peer components. It is always called by AWT (or by an application) to "realize" the widget. Because SWT creates the native "peer" during construction, an addNotify-like method isn't necessary.
 
To extend in a similar manner, you would need to add code to the constructor of your subclass, or override other methods that perform the functions you need.
 
Hope this helps!
-- Scott

Back to the top