This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2009-08-03 11:40:18

jagnobli
Scratcher
Registered: 2007-10-24
Posts: 8

readSkinFrom: aDirectory

Hi there,

I am slightly confused: I want to use an altered ScratchSkin directory at startup of scratch using the scratch source...

But I am not sure how to use the class method readSkinFrom: aDirectory to initialize my own dictionary...as far as I understand it, it should be called in ScratchFrameMorph new before

Code:

ScratchSkin ifNil: [^ super new].  "no default skin"

(?)

I am using a mac and the absolute path is /ScratchSource/ScratchSkin therefore I tried

Code:

self readSkinFrom: '/ScratchSource/ScratchSkin'.

Suggestions are very welcome...

cheers

Offline

 

#2 2009-08-03 12:40:47

jagnobli
Scratcher
Registered: 2007-10-24
Posts: 8

Re: readSkinFrom: aDirectory

Thinking about it, it might be inappropriate to create the dictionary on every startup...how can I use the workspace for 'onetime initialization' of that dictionary calling something like 

Code:

ScratchFrameMorph readSkinFrom: '/ScratchSource/ScratchSkin'

?

cheers

Last edited by jagnobli (2009-08-03 12:41:47)

Offline

 

#3 2009-08-04 06:03:46

jagnobli
Scratcher
Registered: 2007-10-24
Posts: 8

Re: readSkinFrom: aDirectory

CLOSED  smile

I have figured it out by myself...

ScratchFrameMorph readSkinFrom: (FileDirectory default directoryNamed: 'ScratchSkin')

as described in the method comments...sometimes it's that easy...

Last edited by jagnobli (2009-08-04 06:04:12)

Offline

 

Board footer