[futurebasic] Re: [FB] HIView questions

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : November 2010 : Group Archive : Group : All Groups

From: Brian S <fblistserve@...>
Date: Wed, 3 Nov 2010 10:41:25 -0700
On Nov 3, 2010, at 10:00 AM, Steve wrote:

> After creating the ImageView, how do I properly delete it?

AFAIK, views are automatically disposed of ( i.e. released ) when their parent view is destroyed. The window contains a root view that has all of the subviews displayed in it, and destroys this root view when it is destroyed. So if you never retain a view (via CFRetain() or the like), then they will automatically be destroyed for you. AFAIK, HIImageViewCreate() does not follow the “Create” rule.

HIImageViewSetImage() may be used to set the image the image view should display instead of destroying and recreating the view each time.

> How can I use an image file outside of the Application bundle?  I have the FSRef of the file but cannot display it in place of the test.jpg

If you have an FSRef, convert it to a CFURLRef( File Directory utilities is one way ) and do the setup and feed to HIViewSetImageContent() as shown in the posted code.

Gotta run… 

Brian S