dwt-addons rework, please test

yidabu yidabu.spam at gmail.com
Fri Aug 8 05:26:01 PDT 2008

On Fri, 08 Aug 2008 11:32:13 +0200
Frank Benoit <keinfarbton at googlemail.com> wrote:

> Are you sure, the imageManager return the Images as non-null?
> This would explain the invalid arg exception.

your are right, the image is null now. but the same code works fine before, causes exception after upgrade to dwtx svn.

perhaps this is an ImageRegistry issue?

I'm sure the Images -JPath is right(have not compile error, and works fine before).

import dwtx.jface.resource.ImageDescriptor;
import dwtx.jface.resource.ImageRegistry;

import dwt.graphics.Image;
import dwt.graphics.ImageData;

import dwt.widgets.Display;
import dwt.dwthelper.utils;

public class ImageManager {

    static const char[] SOFT32_ICO = "soft32.ico";
    static const char[] SOFT32_PNG = "soft32.png";

        ir = new ImageRegistry();

        ir.put(SOFT32_ICO, ImageDescriptor.createFromFile(getImportData!(SOFT32_ICO)));       
        ir.put(SOFT32_PNG, ImageDescriptor.createFromFile(getImportData!(SOFT32_PNG)));

        assert( get(SOFT32_ICO) !is null);//image is null
        assert( get(SOFT32_PNG) !is null); //image is null 

    Image get(char[] key)
        return ir.get(key);

    private ImageRegistry ir;

} // end class ImageManager

yidabu <yidabu.spam at gmail.com>

D 语言-中文(D Chinese):

More information about the Digitalmars-d-dwt mailing list