Changeset 12:47a66440dddd

Show
Ignore:
Timestamp:
02/14/08 18:17:21 (10 months ago)
Author:
Frank Benoit <benoit@tionex.de>
branch:
default
Message:

made the resources for Snippet258 included at compile time

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • dsss.conf

    r11 r12  
    11 
    22[*] 
    3 buildflags+=-g -gc -debug 
     3debugflags+=-g -gc -debug 
     4 
     5#used for dwtsnippets/text/Snippet258 
     6buildflags+=-Jdwtsnippets/images 
     7 
    48version(Windows){ 
    59    #buildflags+= -L/SUBSYSTEM:windows:5 
    610    buildflags+= -L/SUBSYSTEM:console:5 
    711} 
     12 
    813# The linker error work around 
    9 buildflags+= -L-lDD-tango-util 
     14version(linux){ 
     15    buildflags+= -L-lDD-tango-util 
     16
    1017 
    1118[dwtexamples/simple.d] 
  • dwtsnippets/text/Snippet258.d

    r11 r12  
    1919 * For a list of all SWT example snippets see 
    2020 * http://www.eclipse.org/swt/snippets/ 
    21  *  
     21 * 
    2222 * @since 3.3 
    23  */  
     23 */ 
    2424import dwt.DWT; 
    2525import dwt.graphics.Image; 
     
    3333import dwt.events.SelectionAdapter; 
    3434import dwt.events.SelectionEvent; 
    35  
     35import dwt.graphics.ImageData; 
     36import dwt.dwthelper.ByteArrayInputStream; 
    3637import tango.io.Stdout; 
    3738 
     
    4041    Shell shell = new Shell(display); 
    4142    shell.setLayout(new GridLayout(2, false)); 
    42      
     43 
    4344    final Text text = new Text(shell, DWT.SEARCH | DWT.CANCEL); 
    4445    Image image = null; 
    4546    if ((text.getStyle() & DWT.CANCEL) == 0) { 
    46         image = new Image (display, "../images/cancel.gif"); 
     47        image = new Image (display, new ImageData(new ByteArrayInputStream( cast(byte[]) import("cancel.gif" )))); 
    4748        ToolBar toolBar = new ToolBar (shell, DWT.FLAT); 
    4849        ToolItem item = new ToolItem (toolBar, DWT.PUSH);