LS97 wrote:
LS97 wrote:
nXIII wrote:
That's an already-defined special-form, I believe #doWhile, maybe?hmm... i suppose so.
i'll play around with those forms.nXIII,
back to page 24 in this thread.
you once told me that the function for the 'When %b is true' block was stored in a special form called doWhile. When i became i little better at squeak, i saw that in fact that's simply for a c block called 'do while %b', which was later replaced by the 'do until %b'.
it's exactly the same thing, but one of them waits until the condition is true, and one until the condition is false. Any other help?
PS. about the special forms for C blocks. How do you take the first argument for the block from the array it's stored into?
@PS: argumentsVariable first.
or (argumentsVaraible at: index)
but make sure to use parentheses on the second one so that the wrapping message stays intact.
Offline
LS97 wrote:
The link block
Ok, finally some time to add the greatest block of all. the block links the user to a webpage, program or file as long as the path or URL is given. add in the blockspecs in the control section some kind of block code (choose whatever you want, you know how to do it). and add in the corresponding instance ops:Code:
Cursor wait showWhile: [ScratchPlugin primOpenURL: t1]So little code for such a great block... and remember to click accept!
In which ops do I put the code!!
Offline
pwiter wrote:
LS97 wrote:
The link block
Ok, finally some time to add the greatest block of all. the block links the user to a webpage, program or file as long as the path or URL is given. add in the blockspecs in the control section some kind of block code (choose whatever you want, you know how to do it). and add in the corresponding instance ops:Code:
Cursor wait showWhile: [ScratchPlugin primOpenURL: t1]So little code for such a great block... and remember to click accept!
In which ops do I put the code!!
In which ops you put the code doesn't matter. It was just created for organization.
Offline
henley wrote:
pwiter wrote:
LS97 wrote:
The link block
Ok, finally some time to add the greatest block of all. the block links the user to a webpage, program or file as long as the path or URL is given. add in the blockspecs in the control section some kind of block code (choose whatever you want, you know how to do it). and add in the corresponding instance ops:Code:
Cursor wait showWhile: [ScratchPlugin primOpenURL: t1]So little code for such a great block... and remember to click accept!
In which ops do I put the code!!
In which ops you put the code doesn't matter. It was just created for organization.
OK I tried that and it said, unknown variable: t1
Offline
pwiter wrote:
henley wrote:
pwiter wrote:
In which ops do I put the code!!
In which ops you put the code doesn't matter. It was just created for organization.
OK I tried that and it said, unknown variable: t1
Okay, if you REALLY REALLY REALLY REALLY want to know. I will give you the WHOLE tutorial!
Step 1: Open the system browser
Step 2: Go to the block specs
Step 3: Enter the block spec:
if in the nonsource version:
('link to %s' #- #linkTo: 'http://scratch.mit.edu/')
if in the source version:
('link to %s' - linkTo: 'http://scratch.mit.edu/')
Step 4: Enter the code for the block in 'other ops'.
Step 5: The code being:
linkTo: t1 Cursor wait showWhile: [ScratchPlugin primOpenURL: t1]
Is there anything else?
Offline
nXIII wrote:
LS97 wrote:
LS97 wrote:
hmm... i suppose so.
i'll play around with those forms.nXIII,
back to page 24 in this thread.
you once told me that the function for the 'When %b is true' block was stored in a special form called doWhile. When i became i little better at squeak, i saw that in fact that's simply for a c block called 'do while %b', which was later replaced by the 'do until %b'.
it's exactly the same thing, but one of them waits until the condition is true, and one until the condition is false. Any other help?
PS. about the special forms for C blocks. How do you take the first argument for the block from the array it's stored into?@PS: argumentsVariable first.
or (argumentsVaraible at: index)
but make sure to use parentheses on the second one so that the wrapping message stays intact.
ok thanks a lot!
anyone else can answer the other q, maybe?
Offline
ok. in case the other question isn't so clear, i would like to know how to make the when hat block work.
Offline
LS97 wrote:
ok. in case the other question isn't so clear, i would like to know how to make the when hat block work.
Oh, I think the When Hat is ('When %b is true' #W #-) I'm not sure about the middle symbol, though.
Offline
@nXIII,
yes it is but it apparently doesnt work with the source code (didnt try Scratch code)
Offline
btw everyone,
I am currently adding color support to bingo! it doesnt have square edges like panther, but it can fit in color arguments like the
[blocks]<touching color[ ]>[/blocks],
and the watcher turns that color if you make it. if you click on the color block the text in the tooltip is that color. it works for pen color too.
oh and i didnt even look at panther's code. so proud of myself
Last edited by LS97 (2010-06-28 03:28:01)
Offline
What do you mean by "click on to class" in the first post?
Offline
hey does anyone know how to have insert a toggle button?
Offline
azaquaz wrote:
What do you mean by "click on to class" in the first post?
click on the button that says class
Offline
dav09 wrote:
hey does anyone know how to have insert a toggle button?
yes i do. here it is:
| tog |
tog _ ToggleButton new.
tog position: 100@100.
tog extent: 100@25.
tog label: 'some label'.
tog actionSelector: #fillScreenOff.
self addMorph: tog.
obviously this code would have to be inserted somewhere inside ScratchFrameMorph for the toggle button to appear correctly and to work. but you can place it in the morph you want, as long as it can have submorphs and the actionSelector symbol (or command, i.e. #fillScreenOff) is present in that morph or owner (if that morph is a submorph). you can choose whatever extent and position you prefer, and change the label.
hope it helps!
EDIT: if you want to run an action which is in another morph, simply add the code
tog target: (WhateverMorph)
before the addMorph code.
Last edited by LS97 (2010-06-28 13:52:55)
Offline
comp500 wrote:
Hi guys! I'm back!
hi
Offline
thanks thats great!
Im still stuck a little though, when i put tog in it changes to t1
Sorry im new to programming
And am in putting it in the right place, on the block i want it(in scratch blocks and in scriptablescratch morph is and the block in sensing i wast it on). thanks
it also comes up "nothing more expected"
ill post an image...
Last edited by dav09 (2010-06-28 15:37:47)
Offline
oh, that's normal since you're using the non-source code. don't worry. just use t1 instead of tog in every place of the code. but, just curious, what do you need it for?
Offline
ok thanks, its because im importing the net scratch blocks to 1.4
this was the image anyway, i know now, thanks
I also realise it needs to be a reporter... not a command!
#g was removed in 1.4
Last edited by dav09 (2010-06-28 16:11:29)
Offline
@dav09,
i still dont get what you need the tog button for. and you could have just looked at the netScratch blocks and copied them exactly to 1.4.
please explain better, this is interesting but confusing
Offline
well i thought i would be cool if netscratch was in 1.4 and i need the tog button next to
bigger pic http://dav2.webs.com/sc11.jpg
i also realised that the type of block which was #g does not exist in 1.4 so i had to edit this andchange it to #r(in block specs)
net scratch was an old experimental version of scratch... never released... (was leaked i think)
Last edited by dav09 (2010-06-28 16:43:28)
Offline
i know about netScratch, but if you needed a checkbox you could have asked for that, it's a specific kind of toggle button. different morph. but wat's the toggle button for anyway?
Offline
oh ok i get it. had a look at netScratch (had it downloaded already) and saw that what you need is NOT a toggle button in the block, but a watcher in front of the block.
that's editable in CommandBlockMorph's canBecomeWatcher, without the need to add the morph directly.
Offline