AddResource 
Author Message
 AddResource

Anyone here know how to add to a resource fork using the addresource command
under resource fork?  it is something like

rf.addresouce data,type,id,name

but it isn't in that format and I cannot figure out the correct format.  Thanks



Sat, 17 Jan 2004 22:35:55 GMT  
 AddResource

Quote:

> Anyone here know how to add to a resource fork using the addresource command
> under resource fork?  it is something like

> rf.addresouce data,type,id,name

> but it isn't in that format and I cannot figure out the correct format.
> Thanks

Well, you do have the correct syntax, with the parameters in the correct
order. You also need to make sure the file has a resource fork, using
FolderItem.CreateResourceFork (if it doesn't already have one. If it does,
.CreateResourceFork will replace the old one with a new, blank resource
fork). Thereafter, if you want to add new resources, you would use
FolderItem.OpenResourceFork to return a ResourceFork.

George



Sat, 17 Jan 2004 23:23:20 GMT  
 AddResource

Quote:



> Well, you do have the correct syntax, with the parameters in the correct
> order. You also need to make sure the file has a resource fork, using
> FolderItem.CreateResourceFork (if it doesn't already have one. If it
> does,
> .CreateResourceFork will replace the old one with a new, blank resource
> fork). Thereafter, if you want to add new resources, you would use
> FolderItem.OpenResourceFork to return a ResourceFork.

> George

and the data has to be in the form of a string... so if it's in some
other format you have you to parse it into a string and then use the
addresource call
-Eli
--
If you build something from the inside out,
you'll have no difficulties penetrating from the outside in


Sun, 18 Jan 2004 23:48:04 GMT  
 AddResource

Quote:
>and the data has to be in the form of a string... so if it's in some
>other format you have you to parse it into a string and then use the
>addresource call

I belive that is my problem.  How do you get a picture into a string? (I want
to add a cicn and an icon).  I want to take the picture from the backdrop of
canvas1.


Mon, 19 Jan 2004 03:37:41 GMT  
 AddResource

Quote:

> >and the data has to be in the form of a string... so if it's in some
> >other format you have you to parse it into a string and then use the
> >addresource call

> I belive that is my problem.  How do you get a picture into a string? (I want
> to add a cicn and an icon).  I want to take the picture from the backdrop of
> canvas1.

you can use the addcicn and addpicture commands, you dont have to handle them as
strings, although, if you want to you can convert the image toa string by
reading it using getresource(type,id)

hope this help.



Mon, 19 Jan 2004 07:33:20 GMT  
 AddResource

Quote:
>addcicn and addpicture

I am using 3.2.1 and there is no addcicn (which would be very helpful) is this
in 3.5b2?


Tue, 20 Jan 2004 02:11:55 GMT  
 AddResource

Quote:

> >addcicn and addpicture

> I am using 3.2.1 and there is no addcicn (which would be very helpful) is this
> in 3.5b2?

It is, but I'm pretty sure it's in 3.0 as well -- we didn't add this
recently.

Cheers,
- Joe

--
,------------------------------------------------------------------.
|    Joseph J. Strout         Check out the Mac Web Directory:     |

`------------------------------------------------------------------'



Tue, 20 Jan 2004 04:33:39 GMT  
 AddResource


Quote:




> > Well, you do have the correct syntax, with the parameters in the correct
> > order. You also need to make sure the file has a resource fork, using
> > FolderItem.CreateResourceFork (if it doesn't already have one. If it
> > does,
> > .CreateResourceFork will replace the old one with a new, blank resource
> > fork). Thereafter, if you want to add new resources, you would use
> > FolderItem.OpenResourceFork to return a ResourceFork.

> > George
> and the data has to be in the form of a string... so if it's in some
> other format you have you to parse it into a string and then use the
> addresource call
> -Eli



Sat, 05 Jun 2004 01:44:29 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Memory leak with AddResource?!

 

 
Powered by phpBB® Forum Software