Bug 6813 - Changes/Additions to document "Create Your Own Widget"
Summary: Changes/Additions to document "Create Your Own Widget"
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 2.0   Edit
Hardware: All Windows 2000
: P4 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-12-11 15:09 EST by Veronika Irvine CLA
Modified: 2021-11-12 11:47 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Veronika Irvine CLA 2001-12-11 15:09:36 EST
1) If your widget has a client area (e.g. overrides computeSize()) then when 
anything happens that could change the size of the client area (e.g. scrollbars 
appear/disappear, font changes and changes the size of the header area) then 
a "fake" SWT.Resize event should be sent to all your children.  Be careful 
because when you use notifyListeners, the SWT.Resize event will also get sent 
to your widget if you are listening for the SWT.Resize event.
Comment 1 Carolyn MacLeod CLA 2001-12-11 16:16:52 EST
KR> I just read your article. I think it's very well written and easy to 
understand (for me anyway <g>) *except* for the Spinner example. I was 
surprised to see that you implement the Spinner using fat natives after Steve's 
article preaches the benefits of the 1:1 Java to native mapping. I think 
readers might be confused if they read Steve's article first and then the 
custom widget article. It's not going to get the message out on how to best do 
your own native wrapper. It would be nice if the Spinner example built on the 
initial SWT article. You could even include a reference pointing to the 
discussion about fat vs. light natives.

SN> You missed the point entirely... we don't want customers accessing our 
internal classes. We did it on purpose.  Also, the idea was to show how to 
interface a native widget, not write the PI, that would cloud the issue.

KR> Good point about the internal classes. Since all the OS stuff you refer to 
in the SWT article is in swt.interal it's off limits for customers. Perhaps 
Car's article should mention this? I think the chapter generally is good and it 
makes sense to have it. It's just not clear why you implement the widget in the 
natives and not do what SWT does. I should have known that you did this because 
the customer isn't supposed to use swt.internal stuff. However, the customer 
won't know (unless they read Jeem's article and didn't forget about the 
internal package rule). After reading Steve's article they'd probably just do 
what SWT does and use OS.java. 
Comment 2 Carolyn MacLeod CLA 2001-12-11 16:20:09 EST
AW> In Car's article about Layouts, she mentiones at the very end how to 
overwrite layout if you install your own ControlListener. However, IMHO it is 
not stressed enough how important this is for clients because they want to be 
able to use a polymorphic layout() that works under all circumstances without 
having to know whether a Layout or whether a ControlListener has been 
installed. In fact in your & Car's article 'Creating your own widgets with SWT' 
in section 'Positioning children on resize' I would not introduce a private 
method 'resize' which implements the layout but would rather overwrite 'layout
(boolean)' to follow the rule.
Comment 3 Carolyn MacLeod CLA 2002-01-18 13:55:06 EST
Maybe should have an example dialog, now that Dialog has been opened up.
Comment 4 Steve Northover CLA 2007-09-20 10:35:15 EDT
Really old doc bug.  Either fix or close.
Comment 5 Eclipse Webmaster CLA 2019-09-06 16:05:00 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.