Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!rutgers!bagate!sjuphil!dcarpent From: dcarpent@sjuphil.uucp (D. Carpenter) Newsgroups: comp.sys.next Subject: displaying an image: how? Message-ID: <1991Jun23.210636.13446@sjuphil.uucp> Date: 23 Jun 91 21:06:36 GMT Reply-To: dcarpent@sjuphil.UUCP () Organization: Saint Joseph's University Lines: 39 Could some compassionate soul tell me what is lacking in the code below? I am trying to write a method that, in response to a button click, will find a tiff image, create a window for it, size the window to the size of the image, and then display it on screen. Probably fairly simple for people who, unlike me, know what they are doing. I have managed to get the window created, and sized to the image, but I can't get the image to display. I haven't explicitly created a View for the window, so perhaps there is nothing to composite into? How would I do this? Here's what I have so far: - displayImage:sender { myImage = [ [NXImage alloc] initFromFile: "/me/anImage.tiff" ]; [myImage getSize:&imageSize]; NXSetRect (&rect, 500.0, 350.0, imageSize.width, imageSize.height); myWindow = [Window newContent:&rect style:NX_TITLEDSTYLE backing:NX_BUFFERED buttonMask:NX_CLOSEBUTTONMASK defer:YES]; [[myWindow display] makeKeyAndOrderFront:self]; [myImage composite:NX_COPY toPoint:&(rect.origin)]; return self; } Thanks in advance for any help. -- =============================================================== David Carpenter dcarpent@sjuphil.UUCP St. Joseph's University dcarpent@sjuphil.sju.edu Philadelphia, PA 19131