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

#1 2011-04-20 14:28:14

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

squeak questions

Hey, two questions:

can Scratch create a FOLDER on your computer using smalltalk and is there a way to create a costume with a chosen text, font, size and colour?

Thanks!


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#2 2011-04-20 14:30:33

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: squeak questions

sparks wrote:

Hey, two questions:

can Scratch create a FOLDER on your computer using smalltalk and is there a way to create a costume with a chosen text, font, size and colour?

Thanks!

Can Scratch do it?  tongue  Do you mean Squeak?

Offline

 

#3 2011-04-20 14:33:06

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: squeak questions

ProgrammingFreak wrote:

sparks wrote:

Hey, two questions:

can Scratch create a FOLDER on your computer using smalltalk and is there a way to create a costume with a chosen text, font, size and colour?

Thanks!

Can Scratch do it?  tongue  Do you mean Squeak?

No. I mean smalltalk. An edited version of Scratch (Panther really) should be able to do these things with smalltalk. Squeak is the VM.


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#4 2011-04-20 14:36:20

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: squeak questions

sparks wrote:

ProgrammingFreak wrote:

sparks wrote:

Hey, two questions:

can Scratch create a FOLDER on your computer using smalltalk and is there a way to create a costume with a chosen text, font, size and colour?

Thanks!

Can Scratch do it?  tongue  Do you mean Squeak?

No. I mean smalltalk. An edited version of Scratch (Panther really) should be able to do these things with smalltalk. Squeak is the VM.

I know. But you said 'Scratch'. OH never mind.  tongue

Yes. It would be. I was actually reading about this. Lemme find it....

Offline

 

#5 2011-04-20 14:36:34

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: squeak questions

It can create a new folder. I'll look for the code.


You can now reach me on Twitter @johnnydean1_

Offline

 

#6 2011-04-20 14:39:30

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: squeak questions

Code:

aStream := aFilenameString asFilename writeStream

That's the setup for it.

Offline

 

#7 2011-04-20 14:51:21

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: squeak questions

Look at this:

UIDialogs-FilePicker-private-newDirectiory
newDirectory
    | t1 |
    t1 _ StringDialog askWithCancel: 'New folder name:'.
    t1 = '' ifTrue: [^ self].
    [self currentDirectory createDirectory: t1]
        ifError: [:t2 :t3 | ^ DialogBoxMorph warn: 'Could not create folder.'].
    self currentDirectory: self currentDirectory


You can now reach me on Twitter @johnnydean1_

Offline

 

#8 2011-04-20 14:54:13

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: squeak questions

johnnydean1 wrote:

Look at this:

UIDialogs-FilePicker-private-newDirectiory
newDirectory
    | t1 |
    t1 _ StringDialog askWithCancel: 'New folder name:'.
    t1 = '' ifTrue: [^ self].
    [self currentDirectory createDirectory: t1]
        ifError: [:t2 :t3 | ^ DialogBoxMorph warn: 'Could not create folder.'].
    self currentDirectory: self currentDirectory

Why not have it as a CustomDialog?

Offline

 

#9 2011-04-20 15:27:43

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: squeak questions

I dunno, but thats what scratch uses!


You can now reach me on Twitter @johnnydean1_

Offline

 

#10 2011-04-20 15:28:18

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: squeak questions

johnnydean1 wrote:

I dunno, but thats what scratch uses!

Oh, so scratch can make files?

Offline

 

#11 2011-04-20 15:38:20

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: squeak questions

ProgrammingFreak wrote:

johnnydean1 wrote:

I dunno, but thats what scratch uses!

Oh, so scratch can make files?

Scratch can make files. Remember the little scratchthumb files that appear in folders when you view it through Scratch?


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#12 2011-04-20 15:43:48

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: squeak questions

sparks wrote:

ProgrammingFreak wrote:

johnnydean1 wrote:

I dunno, but thats what scratch uses!

Oh, so scratch can make files?

Scratch can make files. Remember the little scratchthumb files that appear in folders when you view it through Scratch?

Ah, yes.  tongue

Offline

 

#13 2011-04-20 15:46:23

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: squeak questions

johnnydean1 wrote:

Look at this:

UIDialogs-FilePicker-private-newDirectiory
newDirectory
    | t1 |
    t1 _ StringDialog askWithCancel: 'New folder name:'.
    t1 = '' ifTrue: [^ self].
    [self currentDirectory createDirectory: t1]
        ifError: [:t2 :t3 | ^ DialogBoxMorph warn: 'Could not create folder.'].
    self currentDirectory: self currentDirectory

Thats your folder problem sorted then!!!


You can now reach me on Twitter @johnnydean1_

Offline

 

#14 2011-04-20 15:58:12

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: squeak questions

johnnydean1 wrote:

johnnydean1 wrote:

Look at this:

UIDialogs-FilePicker-private-newDirectiory
newDirectory
    | t1 |
    t1 _ StringDialog askWithCancel: 'New folder name:'.
    t1 = '' ifTrue: [^ self].
    [self currentDirectory createDirectory: t1]
        ifError: [:t2 :t3 | ^ DialogBoxMorph warn: 'Could not create folder.'].
    self currentDirectory: self currentDirectory

Thats your folder problem sorted then!!!

It looks good - didn't work as a custom block though...


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#15 2011-04-20 16:05:01

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: squeak questions

sparks wrote:

johnnydean1 wrote:

johnnydean1 wrote:

Look at this:

UIDialogs-FilePicker-private-newDirectiory
newDirectory
    | t1 |
    t1 _ StringDialog askWithCancel: 'New folder name:'.
    t1 = '' ifTrue: [^ self].
    [self currentDirectory createDirectory: t1]
        ifError: [:t2 :t3 | ^ DialogBoxMorph warn: 'Could not create folder.'].
    self currentDirectory: self currentDirectory

Thats your folder problem sorted then!!!

It looks good - didn't work as a custom block though...

Read how it works. The currentDirectory needs setting.


You can now reach me on Twitter @johnnydean1_

Offline

 

#16 2011-04-20 16:21:03

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: squeak questions

currentDirectory appears to be an "already in use" variable. I can't set it or declare it.


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#17 2011-04-20 16:22:10

bbbeb
Scratcher
Registered: 2009-06-11
Posts: 1000+

Re: squeak questions

its the programs current directory.

tongue


Back in my day.... there were no laws that censored the internet... now, there are.... nah.

Offline

 

#18 2011-04-20 16:25:05

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: squeak questions

Ill let you discuss this. I don't get how it works.


You can now reach me on Twitter @johnnydean1_

Offline

 

#19 2011-04-20 16:35:04

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: squeak questions

bbbeb wrote:

its the programs current directory.

tongue

hm... then how come the block won't currently work? It gives me the syntax error:

Code:

| t1 |
t1 _ 'test'.
UIDialogs-FilePicker-private-newDirectiory
newDirectory
    | t1|
    t1 Nothing more expected ->_ StringDialog askWithCancel: 'New folder name:'.
    t1 = '' ifTrue: [^ self].
    [self currentDirectory createDirectory: t1]
        ifError: [:t2 :t3 | ^ DialogBoxMorph warn: 'Could not create folder.'].
    self currentDirectory: self currentDirectory

Last edited by sparks (2011-04-20 16:35:53)


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#20 2011-04-20 16:45:01

bbbeb
Scratcher
Registered: 2009-06-11
Posts: 1000+

Re: squeak questions

This is the problem?

Code:

t1 _ StringDialog askWithCancel: 'New folder name:'.

1. Destroy the
t1_ 'test'.
You dont need that.
2. You declared t1 twice,
that may cause syntax problems.


Back in my day.... there were no laws that censored the internet... now, there are.... nah.

Offline

 

#21 2011-04-20 16:55:37

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: squeak questions

bbbeb wrote:

This is the problem?

Code:

t1 _ StringDialog askWithCancel: 'New folder name:'.

1. Destroy the
t1_ 'test'.
You dont need that.
2. You declared t1 twice,
that may cause syntax problems.

t1 is only declared once and never set to 'test' if you look at the actual block code:

Code:

UIDialogs-FilePicker-private-newDirectiory
newDirectory
    | t1|
    t1 _ StringDialog askWithCancel: 'New folder name:'.
    t1 = '' ifTrue: [^ self].
    [self currentDirectory createDirectory: t1]
        ifError: [:t2 :t3 | ^ DialogBoxMorph warn: 'Could not create folder.'].
    self currentDirectory: self currentDirectory

http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#22 2011-04-21 03:43:51

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: squeak questions

It is not the current directory of the Scratch project. When you are in a file browser window, the directory your looking at is the currentDirectory.


You can now reach me on Twitter @johnnydean1_

Offline

 

#23 2011-04-21 03:46:48

bbbeb
Scratcher
Registered: 2009-06-11
Posts: 1000+

Re: squeak questions

johnnydean1 wrote:

It is not the current directory of the Scratch project. When you are in a file browser window, the directory your looking at is the currentDirectory.

ooohhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh

then somethings wrong with my logic atm
*cough*tryingtolearnC++issohard*cough*


Back in my day.... there were no laws that censored the internet... now, there are.... nah.

Offline

 

#24 2011-04-21 04:27:43

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: squeak questions

bbbeb wrote:

johnnydean1 wrote:

It is not the current directory of the Scratch project. When you are in a file browser window, the directory your looking at is the currentDirectory.

ooohhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh

then somethings wrong with my logic atm
*cough*tryingtolearnC++issohard*cough*

C++ isn't thats hard.


You can now reach me on Twitter @johnnydean1_

Offline

 

#25 2011-04-21 04:42:01

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: squeak questions

johnnydean1 wrote:

bbbeb wrote:

johnnydean1 wrote:

It is not the current directory of the Scratch project. When you are in a file browser window, the directory your looking at is the currentDirectory.

ooohhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh

then somethings wrong with my logic atm
*cough*tryingtolearnC++issohard*cough*

C++ isn't thats hard.

Win32 C++ is a real pain!
It's all illogical, you're better of learning the .NET version if you want to keep your sanity.

Offline

 

Board footer