Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Mac OS X port: Tree/MacUtil question


Here's an oddity for you: When they were implementing the Palm version of SWT, it turned out to be faster to create an in memory file containing the resource information and call the Palm equivalent of GetNewControl, than it was to create the widget directly. I'm not suggesting that we do this; I just thought it was an interesting tidbit.

McQ.



Andre Weinand <weinand@xxxxxxx>
Sent by: platform-swt-dev-admin@xxxxxxxxxxx

06/28/2002 06:20 PM
Please respond to platform-swt-dev

       
        To:        platform-swt-dev@xxxxxxxxxxx
        cc:        
        Subject:        Re: [platform-swt-dev] Mac OS X port: Tree/MacUtil question



Martin,

>Today I started looking over the DataBrowser again.
>Browsing both the Carbon API and the SWT hierarchy I found you use
>the Carbon function "newControl()" to create and embed new controls
>in "MacUtil.newControl()".
>The Carbon API says using the native function "newControl()" is not
>recommended but instead use "GetNewControl()"
>Do you use "newControl()" by purpose or by *accident* ?
>I think we should try to migrate to using the _new_ method
>"GetNewControl()" except you know any reason why not.

I use NewControl on purpose. Here is why:

GetNewControl() expects all initial arguments in a resource.
NewControl() takes the arguments directly.

The former makes only sense if you are using a tool like a graphical
UI builder that
stores all parameters for a control in a resource file.
The latter is used when creating the control programatically.

Since SWT lets you create controls only programatically it would not
make much sense to have to store the arguments in a resource file
first.

Where do you find the statement that "using the native function
'NewControl()' is not recommended"?

--andre

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



Back to the top