Changeset 73

Show
Ignore:
Timestamp:
05/20/07 07:08:51 (2 years ago)
Author:
lindquist
Message:

added imageview sample

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/bughunt/dsss.conf

    r63 r73  
    1010 
    1111[samples/idle.d] 
     12[samples/imageview.d] 
    1213[samples/layout.d] 
    1314[samples/menus.d] 
  • branches/bughunt/minwin/peer.d

    r60 r73  
    4646            version (MinWin32) { 
    4747                int ok = DeleteObject(peer); 
    48                 sysAssert(ok != false, "Failed to dispose peer Font"); 
     48                sysAssert(ok != false, "Failed to dispose peer"); 
    4949            } else version (GTK) { 
    5050                g_object_unref(cast(GObject*)peer); 
  • branches/bughunt/minwin/window.d

    r72 r73  
    663663 
    664664        Image loadCompatibleImage(char[] imageKey, char[] fmt = "bmp") { 
     665            char[] fname = imageKey; 
     666            if (gApp.resourcePath.length > 0) { 
     667                fname = gApp.resourcePath ~ "/" ~ fname; 
     668            } 
     669            return loadCompatibleImageFile(fname ~ "." ~ fmt); 
     670        } 
     671 
     672        Image loadCompatibleImageFile(char[] imagefile) { 
    665673            GtkWidget* widget = cast(GtkWidget*)content; 
    666674            GdkDrawable* gwin = cast(GdkDrawable*)widget.window; 
    667675            GError* err; 
    668             char[] fname = imageKey; 
    669             if (gApp.resourcePath.length > 0) { 
    670                 fname = gApp.resourcePath ~ "/" ~ fname; 
    671             } 
    672             fname = fname ~ "." ~ fmt; 
    673             GdkPixbuf* pbuf = gdk_pixbuf_new_from_file(toStringz(fname),&err); 
     676            GdkPixbuf* pbuf = gdk_pixbuf_new_from_file(toStringz(imagefile),&err); 
     677            if (err !is null || pbuf is null) 
     678                return null; 
    674679            int width = gdk_pixbuf_get_width(pbuf); 
    675680            int height = gdk_pixbuf_get_height(pbuf);