Skip to main content

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


Actually, the native widgets of all of the platforms we support require the parent to be specified when the widget is created.

The way AWT gets around this is by keeping two copies of all the widget state: one in slots in the widget, and one in the operating system. One of the reasons why AWT widgets sometimes paint inconsistantly is because this state isn't always 100% consistant (note: when this happens, it's because of a bug in the AWT widget implementation, not something inherently wrong with the idea). The real problem though is that, you *do* have to maintain both copies of this state. That is the part of the problem that Pat Mueller was indicating made the AWT code more complex.

SWT simply creates the widget in the constructor, so that all required state can always be maintained on the o/s side.

McQ.



dr_seltsam@xxxxxx
Sent by: platform-swt-dev-admin@xxxxxxxxxxx

04/22/2002 08:24 AM
Please respond to platform-swt-dev

       
        To:        platform-swt-dev@xxxxxxxxxxx
        cc:        
        Subject:        Re: Re: [platform-swt-dev] Some questions for the SWT developers


Hello Carolyn!


> From: Carolyn_MacLeod@xxxxxxx
> Date: Sun, 21 Apr 2002 20:55:26 -0400
> Delivered-to: platform-swt-dev@xxxxxxxxxxx
>
>       Swing widgets are "lightweight", which means that they are drawn
>        by the widget toolkit when they need to be displayed. They can be
>        created without a parent and passed around, etc., but they don't
>        need to have a platform handle until the moment when they are
drawn.
>
>        SWT widgets are real platform widgets. Each widget has a platform
>        handle from the moment it is created, which means it needs a
parent.
>        Most platforms do not support creating a widget without specifying
>        its parent. Perhaps it is better explained in this SWT FAQ entry:

AWT widgets are "heavyweight" like SWT ones but still they don't need a
parent argument in their constructor! I can't believe that an OS needs a parent
reference for creating a widget. Which OS needs this? How is AWT able to do it
without?


Thank you for your answers,
Dr. Seltsam

--
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net

_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-swt-dev



Back to the top