dwt-addons rework, please test
Frank Benoit
keinfarbton at googlemail.com
Fri Aug 8 02:32:13 PDT 2008
yidabu schrieb:
> On Fri, 8 Aug 2008 07:56:51 +0800
> yidabu <yidabu.spam at gmail.com> wrote:
>
>> On Thu, 07 Aug 2008 15:32:48 +0200
>> Frank Benoit <keinfarbton at googlemail.com> wrote:
>>
>>> I did a rework of the use of collections and added a new collection
>>> wrapper. The new wrappers make use of the new tango.util.containers
>>> instead of the prior code that used tango.util.collection directly.
>>>
>>> The new collection wrappers in dwtx.dwtxhelper.Collection have still
>>> many unimplemented methods. If such one is called, the application is
>>> terminated immediatly with a message of file and line.
>>>
>>> I did a few tests with examples to catch many of the unimplemented
>>> methods. If you encounter such a messages
>>>
>>> implementation missing in file
>>> ../dwt-addons/dwtx/dwtxhelper/Collection.d line 1527
>>>
>>> please report that so the implementation can be added quickly.
>>> Or if you want you can also send me patches or hg bundles :)
>> I tested 3 dwtx(svn) based apps, all get run time exception:
>>
>> nhandled D Exception (tango.core.Exception.IllegalArgumentException
>> "Argument not valid") at KERNEL32.dll (0x7c812a5b) thread(2444)
>> ->us
>> #0 ?? () at myProgram.d:38 from KERNEL32.dll
>> #1 0x0040a08c in __d_throw at 4 () at myProgram.d:38 from deh
>> #2 0x0040411e in _Dmain (args = {
>> [0] = "myProgram"
>> }) at myProgram.d:38
>> #3 0x00408764 in extern (C) int dmain2.main(int, char**) . void runMain(void*) () from dmain2
>> #4 0x0040879b in extern (C) int dmain2.main(int, char**) . void runAll(void*) () from dmain2
>> #5 0x004084dc in _main () from dmain2
>> #6 0x00511119 in _mainCRTStartup () from constart
>> #7 0x7c816fd7 in ?? () from KERNEL32.dll
>>
>> I'm not sure what's the problem.
>
>
> I found the problem that with shell.setImages:
>
> protected void configureShell(Shell shell)
> {
> super.configureShell(shell);
>
> /// cause IllegalArgumentException
> //shell.setImages([imageManager.get(imageManager.SOFT32_ICO), imageManager.get(imageManager.SOFT32_PNG)]);
> }
>
>
The source of setImages:
/**
* Sets the receiver's images to the argument, which may
* be an empty array. Images are typically displayed by the
* window manager when the instance is marked as iconified,
* and may also be displayed somewhere in the trim when the
* instance is in normal or maximized states. Depending where
* the icon is displayed, the platform chooses the icon with
* the "best" attributes. It is expected that the array will
* contain the same icon rendered at different sizes, with
* different depth and transparency attributes.
*
* @param images the new image array
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_INVALID_ARGUMENT - if one of the images is null or has
been disposed</li>
* </ul>
* @exception DWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread
that created the receiver</li>
* </ul>
*
* @since 3.0
*/
public void setImages (Image [] images) {
checkWidget ();
// DWT extension: allow null array
//if (images is null) error (DWT.ERROR_INVALID_ARGUMENT);
for (int i = 0; i < images.length; i++) {
if (images [i] is null || images [i].isDisposed ()) error
(DWT.ERROR_INVALID_ARGUMENT);
}
this.images = images;
setImages (null, images);
}
Are you sure, the imageManager return the Images as non-null?
This would explain the invalid arg exception.
More information about the Digitalmars-d-dwt
mailing list