Just a theory (please quote and check my logic)but I think:
All languages are originally written in binary.
All commands in all languages can translate back to binary.
Computers run everything in binary.
Squeak could call binary functions.
Squeak can call C++, jave e.t.c.!
Offline
shadowmouse wrote:
Just a theory (please quote and check my logic)but I think:
All languages are originally written in binary.
All commands in all languages can translate back to binary.
Computers run everything in binary.
Squeak could call binary functions.
Squeak can call C++, jave e.t.c.!
Binary > Assembly > Low Level Languages such as C++ > High Level Languages such as BASIC
Squeak can interact with other languages through plugins.
I figured out how to make blocks that only show on Windows/Mac. Here is a screenshot including the code I used: https://dl.dropboxusercontent.com/u/376 … 9%20PM.png
Offline
That's what I was thinking but then I thought, surely you'd want to change either the settingsMorph (for different languages) or rebuildCategorySelctors so that certain languages only appear on certain OSs. I'm making squeak blocks at the moment but I'm encountering a few problems: my
Squeak: [ ]doesn't work. The blockSpec for it is doSqueakCode: t1 (next line) t1, but I've also tried t1 asSymbol and neither work. Also, it's impossible to make a new line within a string input. Can you think of any way to solve eithe problem?
Offline
shadowmouse wrote:
That's what I was thinking but then I thought, surely you'd want to change either the settingsMorph (for different languages) or rebuildCategorySelctors so that certain languages only appear on certain OSs. I'm making squeak blocks at the moment but I'm encountering a few problems: my
Squeak: [ ]doesn't work. The blockSpec for it is doSqueakCode: t1 (next line) t1, but I've also tried t1 asSymbol and neither work. Also, it's impossible to make a new line within a string input. Can you think of any way to solve eithe problem?
To run Squeak code:
runCode: code ^ Compiler evaluate: code for: self logged: false
Run the Squeak code and report result:
reportCode: code ^ Compiler evaluate: code for: self logged: false
I found the code for a multiline input box a while ago. I think I copied it from Bingo.
Paste this into a Squeak workspace and file it in:
'From MIT Squeak 0.9.4 (June 1, 2003) [No updates present.] on 13 April 2013 at 6:49:48 pm'! ExpressionArgMorph subclass: #ExpressionMultiArgMorph instanceVariableNames: 'toggleMorph ' classVariableNames: '' poolDictionaries: '' category: 'Scratch-Blocks'! !ExpressionMultiArgMorph methodsFor: 'event handling'! toggleExpansion DialogBoxMorph inform: 'hi'! ! !ExpressionMultiArgMorph methodsFor: 'accessing'! evaluate ^ labelMorph contents! ! !ExpressionMultiArgMorph methodsFor: 'accessing'! fixArgLayout | t1 t2 | t1 _ self top. self extent: labelMorph extent + (2 @ -1). t2 _ 3. ScratchTranslator isRTL ifTrue: [labelMorph position: self right - (t2 + labelMorph width) @ t1] ifFalse: [labelMorph position: self left + t2 @ t1]! ! !ExpressionMultiArgMorph methodsFor: 'accessing'! numExpression: t1 labelMorph contents: t1. self fixArgLayout! ! !ExpressionMultiArgMorph methodsFor: 'accessing'! stringExpression: t1 labelMorph contents: t1. self fixArgLayout! ! !ExpressionMultiArgMorph methodsFor: 'initialization' stamp: 'NP 8/30/2012 20:18'! initialize super initialize. self useRoundedCorners. isNumber _ false. self stringExpression: ''. labelMorph _ MultilineStringMorph new growWithText: true; extent: 150 @ 20; borderWidth: 0; useRoundedCorners; font: (ScratchFrameMorph getFont: #Arg); color: Color transparent. toggleMorph _ ImageMorph new form: (ScratchFrameMorph skinAt: #arrowOpenComment); position: labelMorph width - 15 @ 2. self addMorph: labelMorph! !
Add this code to Scratch-Blocks > CommandBlockMorph > private > uncoloredArgMorphFor:
$B = t2 ifTrue: [^ ExpressionMultiArgMorph new stringExpression: 'multiline!'; extent: 70 @ 20].
Use %B in your block specs instead of using %s where you want to use multiline inputs.
Offline
Thanks so much! Do you have any idea why the background of the scipting pane goes blank grey if I change the image in the scratchSkin (I haven't changed the name)?
Offline
And what's ExpressionMultiArgMorph, the source code doesn't have that one, it must have been put in by the maker(s) of bingo (LS97?)?
Offline
Oh, sorry. I tried to do the uncoloredArgMorphFor: before the bit that goes in a workspace. It accepts it now.
Offline
shadowmouse wrote:
Thanks so much! Do you have any idea why the background of the scipting pane goes blank grey if I change the image in the scratchSkin (I haven't changed the name)?
Did you save the image in the correct format? Sometimes when I mess around with the options in GIMP, it messes up the skin.
shadowmouse wrote:
And what's ExpressionMultiArgMorph, the source code doesn't have that one, it must have been put in by the maker(s) of bingo (LS97?)?
I exported ExpressionMultiArg from Bingo 2.0, but renamed it with "Morph" at the end, like all the other arg morphs have.
shadowmouse wrote:
Oh, sorry. I tried to do the uncoloredArgMorphFor: before the bit that goes in a workspace. It accepts it now.
Lol.
Offline
I haven't changed the format. I've got several scratchSkin backups, only one of which I've changed and the file formats are the same. Mysterious! And do you know how the if else block is made. I'm trying to make an ifTrue: ifFalse: block but it only comes up wih one c shape even though the method is copied straight from if else?
Offline
shadowmouse wrote:
I haven't changed the format. I've got several scratchSkin backups, only one of which I've changed and the file formats are the same. Mysterious! And do you know how the if else block is made. I'm trying to make an ifTrue: ifFalse: block but it only comes up wih one c shape even though the method is copied straight from if else?
What do you mean by ifTrue: ifFalse: block?
BTW, What time zone are you in?
Offline
nathanprocks wrote:
shadowmouse wrote:
I haven't changed the format. I've got several scratchSkin backups, only one of which I've changed and the file formats are the same. Mysterious! And do you know how the if else block is made. I'm trying to make an ifTrue: ifFalse: block but it only comes up wih one c shape even though the method is copied straight from if else?
What do you mean by ifTrue: ifFalse: block?
BTW, What time zone are you in?
I mean like the if else block but with the top line being ifTrue: and the second line being ifFalse:. I'm on British summer time at the moment. I'm not sure what my profile says, I'll go change it.
Offline
It was on -05 but I've changed it now, though it seemed to change back. Testing.
Offline
shadowmouse wrote:
nathanprocks wrote:
shadowmouse wrote:
I haven't changed the format. I've got several scratchSkin backups, only one of which I've changed and the file formats are the same. Mysterious! And do you know how the if else block is made. I'm trying to make an ifTrue: ifFalse: block but it only comes up wih one c shape even though the method is copied straight from if else?
What do you mean by ifTrue: ifFalse: block?
BTW, What time zone are you in?I mean like the if else block but with the top line being ifTrue: and the second line being ifFalse:. I'm on British summer time at the moment. I'm not sure what my profile says, I'll go change it.
Is the ifTrue: ifFalse block going to be a Squeak block?
You can't change your time zone on these forums for some reason I don't know.
Last edited by nathanprocks (2013-04-13 09:26:39)
Offline
nathanprocks wrote:
shadowmouse wrote:
nathanprocks wrote:
What do you mean by ifTrue: ifFalse: block?
BTW, What time zone are you in?I mean like the if else block but with the top line being ifTrue: and the second line being ifFalse:. I'm on British summer time at the moment. I'm not sure what my profile says, I'll go change it.
Is the ifTrue: ifFalse block going to be a Squeak block?
You can't change your time zone on these forums for some reason I don't know.
Yes it will. I'm working on making the blocks to do the command self referencePosition: self referencePosition + (t1@t2) which will be
self referencePosition: ( ) <self referencePosition> <( )@( )>.
Offline
shadowmouse wrote:
nathanprocks wrote:
shadowmouse wrote:
I mean like the if else block but with the top line being ifTrue: and the second line being ifFalse:. I'm on British summer time at the moment. I'm not sure what my profile says, I'll go change it.
Is the ifTrue: ifFalse block going to be a Squeak block?
You can't change your time zone on these forums for some reason I don't know.Yes it will. I'm working on making the blocks to do the command self referencePosition: self referencePosition + (t1@t2) which will be
self referencePosition: ( ) <self referencePosition> <( )@( )>.
I'm having problems with all of them at the moment, I think becuse of it trying to move a ScratchFrameMorph rather than the sprite, but I'm still working on it. Do you know how to do the ifTrue: ifFalse: block?
I think I finally understand what you mean.
Is it like this?
[Smalltalk isWindows] ifTrue: | "Self destruct code" | "(Insert code to break Scratch here)" | Smalltalk snapshot: true andQuit: true. ifFalse: | self forward 10.
EDIT: Also adding some security features later would be great too, so you don't break the mod with itself. Someone could easily make a script that breaks the mod and saves the image.
Last edited by nathanprocks (2013-04-13 10:27:47)
Offline
nathanprocks wrote:
I think I finally understand what you mean.
Is it like this?Code:
[Smalltalk isWindows] ifTrue: | "Self destruct code" | "(Insert code to break Scratch here)" | Smalltalk snapshot: true andQuit: true. ifFalse: | self forward 10.
Yes.
nathanprocks wrote:
EDIT: Also adding some security features later would be great too, so you don't break the mod with itself. Someone could easily make a script that breaks the mod and saves the image.
I see what you mean. I'll keep regular backups in case any code that I do put on (e.g. that someone suggest) brakes it.A ban on certain commands such as the ability to send e-mails or the ability to download files and run them should probably also be done.
Offline
shadowmouse wrote:
nathanprocks wrote:
I think I finally understand what you mean.
Is it like this?Code:
[Smalltalk isWindows] ifTrue: | "Self destruct code" | "(Insert code to break Scratch here)" | Smalltalk snapshot: true andQuit: true. ifFalse: | self forward 10.Yes.
nathanprocks wrote:
EDIT: Also adding some security features later would be great too, so you don't break the mod with itself. Someone could easily make a script that breaks the mod and saves the image.
I see what you mean. I'll keep regular backups in case any code that I do put on (e.g. that someone suggest) brakes it.A ban on certain commands such as the ability to send e-mails or the ability to download files and run them should probably also be done.
I will attempt to make the ifTrue: ifFalse: block "later is the day" because it is 1:02 AM here.
The ability to save the image and quit should be banned too.
Last edited by nathanprocks (2013-04-13 11:01:58)
Offline
I've just been rooting around the browser and looking at the squeak tutorial on the wiki and I've found Morphic-Menus and Primitives-C Translator. These could be useful!
Offline
shadowmouse wrote:
I've just been rooting around the browser and looking at the squeak tutorial on the wiki and I've found Morphic-Menus and Primitives-C Translator. These could be useful!
I have seen those both both, but never understood what they do. I should really go to bed... It is 2:11 AM now.
Offline
Primitives-C translator translates everything into C so that Scratch has the versatility of C but the awesomeness of squeak. I'm not sure specifically what Morchic-Menus does but I've been trying to make a language morph which has several pictures (one for each future language) that when pressed set a global variable to 1 or 0 but it's all very complicated so I'll go back to doing squeak blocks.
Offline
nathanprocks wrote:
Squeak can interact with other languages through plugins.
I've been looking at that and it seems that to build a plugin you need VMmaker, any other tools neded to make a VM at least some understanding of C, Squeak and possibly Slang (another dialect). Do you know anyone (either someone on the forums or in real life) who would have the skills to do this?
Offline
shadowmouse wrote:
nathanprocks wrote:
Squeak can interact with other languages through plugins.
I've been looking at that and it seems that to build a plugin you need VMmaker, any other tools neded to make a VM at least some understanding of C, Squeak and possibly Slang (another dialect). Do you know anyone (either someone on the forums or in real life) who would have the skills to do this?
No, I do not know anyone who has those skills.
I tried to make the ifTrue: ifFalse: block, but when I change the if else block spec, it turns into a normal c-shaped block.
Offline
nathanprocks wrote:
I tried to make the ifTrue: ifFalse: block, but when I change the if else block spec, it turns into a normal c-shaped block.
Same. I asked LS97 for help with making plugins but even he/she can't do it. Trust me to come up with simple, easy to do ideas.
Offline
O.K. final two things, I'm on exam half-term at school so I'll have literaly no time.
1) Do we need an installer and if so how?
2)How do we make a compiler for GLOOP/edit an existing one?
Offline
shadowmouse wrote:
O.K. final two things, I'm on exam half-term at school so I'll have literaly no time.
1) Do we need an installer and if so how?
2)How do we make a compiler for GLOOP/edit an existing one?
For Windows computers, we could use iexpress.exe, which is hidden in Windows computers. I think NSIS would be a better idea though. It also isn't really a "compiler". It packs all the required files into an executable file that runs the program inside the package.
1. The package must contain the Squeak VM (GLOOP.exe), GLOOP.image, the GLOOP project, and any other files required by the mod. In this case, we would have to pack any compilers/interpreters for other programming languages that your mod needs. We can't pack Visual Basic. We should be able to pack a C/C++ compiler such as GCC. If can pack Python, the packed .exe file would be a big. I think that Python should be installed manually by the user, so that he/she does not fill their hard disk with GLOOP files.
2. The mod should exit when the exit presentation mode button is clicked. We should be able to do this so that we don't need two separate .image files. I think that GLOOP's presentation mode should not be in full-screen and it should fill the window.
3. The packed .exe file should run something like "GLOOP.exe GLOOP.image project-file.gloop presentation". (I can't remember if that's how to do it or not)
For Mac, I could find a way to do that, but I haven't got time to do that right now.
For the installer: We can make a GLOOP installer for Windows using NSIS. Most Mac apps that are not from the App Store are downloaded as a disk image (.dmg) that is mounted by opening the file. The disk image contains the app and a shortcut to the Applications folder (/Applications). The app is simply installed by dragging the app on to the Applications shortcut. Most disk images have a background image telling the user to drag the app into Applications. Unsigned Mac apps must be run by control-clicking (right-clicking) the .app and clicking Open, unless the user has changed their security settings or are using a version of Mac lower than 10.8 (Mountain Lion).
Last edited by nathanprocks (2013-04-17 01:23:53)
Offline