Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Drawing a simple image

Drawing a simple image
Thread Tools
Wes
Junior Member
Join Date: Apr 2001
Status: Offline
Reply With Quote
Jul 15, 2004, 03:30 AM
 
How do I make an image display after a user action? I have a small gif that I would like to appear after the user clicks a button. It is in a NSImageView and will display if I loop it (it is an animation), but I would like it to only show up after the user clicks a button.
     
djohnson
Professional Poster
Join Date: Sep 2000
Location: Texas
Status: Offline
Reply With Quote
Jul 15, 2004, 10:09 AM
 
Why not something like this:

You will need an outlet to an NSImageView.

IBOutlet NSImageView *imageView;

When the user clicks the button, it will call an action. This action will have something like:

-(void)actionName {
...
[imageView imageNamed:[NSImage imageNamed:@"name.gif"]];
...
}

Make sure that gif is added as part of your project!

Here are the NSImageView and NSImage developer pages:

NSImageView

NSImage
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 09:57 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,