talk about dwt,jface executable size

yidabu yidabu.spam at gmail.com
Fri May 23 19:25:41 PDT 2008


dwt hello world size : 1.50 MB
jface hello world size: 2.52 MB

the size is not too big!
the main issue seems too long to build a static library by dsss, this may be a dsss issue.
I hope that dmd 1.031 will fix the anonymous classe bug and we can use the -lib build flag to build a static dwt lib, dwtx.lib

tested with dwt-win svn, dwt-addons svn, dmd 1.028
build dwt.lib and dwtx.lib by dsss 0.75
testd on Windows XP


dwt helloworld:

code:

import dwt.widgets.Display;
import dwt.widgets.Shell;
pragma(lib, "dwt.lib");
pragma(lib, "dwtx.lib");
void main ()
{
    auto display = new Display;
    auto shell = new Shell(display);
    shell.setText = "Hello DWT World ";
    shell.open;
    while (!shell.isDisposed)
        if (!display.readAndDispatch)
            display.sleep;

    display.dispose;
}

build command:

dmd test.d dwt.res -L/SUBSYSTEM:windows:5 -L/rc:dwt.res -J..\dwt-samples\res -J..\dwt-addons\res -release

executable size:
1.50 MB



Jface hello world

code:
import  
    dwt.widgets.Display,
    dwt.widgets.Shell,
    dwt.DWT,
    dwt.widgets.Control,
    dwt.widgets.Composite,
    dwt.widgets.Label,
    dwtx.jface.window.ApplicationWindow;

public class MyWindow : ApplicationWindow
{    
    this()
    {
        super(null);
    }
    void run()
    {        
        setBlockOnOpen(true);
        open();
        Display.getCurrent.dispose;
    }
    
    protected Control createContents(Composite parent)
    {
        auto label = new Label(parent, DWT.CENTER);
        label.setText("hello");
        return label;
    }
    
}

void main(char[][] args)
{
    (new MyWindow).run;
        
}  


executable size : 2.52 MB



-- 
yidabu <yidabu.spam at gmail.com>
http://www.dsource.org/projects/dwin

D 语言-中文(D Chinese):
http://www.d-programming-language-china.org/
http://bbs.d-programming-language-china.org/
http://dwin.d-programming-language-china.org/
http://scite4d.d-programming-language-china.org/




More information about the Digitalmars-d-dwt mailing list