Step 5Step 5 Making a window
Let's start by making a new procedure.
Click File then Edit
Name this new procedure Box.
Press enter after the word box
Now type:
windowcreate "main "mywindow "Autodraw 0 0 50 50 [ ]
Autodraw is the display name of the box and mywindow is the name MSW Logo uses for other things.
The 0 0 are the setxy coordinates of the box.
The 50 50 is the size of the box.
Now click File save and exit.
Now type in the commander window :
Box
Then press enter.
A simple window is created at the top left of the screen.
Now click edall and press enter after (windowcreate "main "mywindow "Autodraw 0 0 50 50 [ ] )
Now lets make some buttons you can click on to do things.
First click the Reset button in the commander window to delete the box.
Type:
buttoncreate "mywindow "mybutton "Square 10 20 30 10 square
Please put brackets around square.
Mywindow is the name of the window the button is going to be in.
Mybutton is the name used for other things.
Square is the display name of the button.
The 10 20 is the setxy coordinates.
The 30 10 is the size of the button.
The brackets around the square tells MSW Logo to run the procedure square
when the button is clicked on.
Now in the commander type :
Box
Then press enter.
A window is made again but this time we have a button.
Now lastly we need to make a button that closes the window instead of having to press reset.
Go back to the procedure box then press enter after the buttoncreate line.
Type:
buttoncreate "mywindow "mybutton2 "Close 10 10 25 10 windowdelete "mywindow
Please put square brackets around windowdelete "mywindow.
The windowdelete deletes a window but first you type "mywindow to tell it which one to delete.
Now go to the commander window and type the procedure box once more and press enter.
Now we have a window with a button that draw a square and a button that closes the window.
Congratulations you now know how to do many things in MSW Logo and should be able to make almost anything now.
Like I said before I can't put square brackets because a link to nowhere is made.
| « Previous Step | Download PDFView All Steps | Next Step » |
![]() |
Add Comment
|

















































