Many beginning programmers find it helpful to examine examples of code written by others. You can pick the example code apart to see how it works. Modify the code to adapt it to your own purposes.
In the Example Projects category are a number of small projects showing how to do a variety of things in XOJO. You can download the projects, open them in XOJO and explore the features they demonstrate. Feel free to copy the code from these projects into you own projects if you wish.
The code of each project is heavily commented to help you understand what is going on.
// open the image file then display it in Canvas1
thePic = f.OpenAsPicture
Canvas1.backdrop = thePic
To learn from these example projects the following strategy is suggested (but you may want to adopt your own approach):
1. Download the project
2. Double-click the project file to open it in XOJO
3. Run the project to see what it does (click Run on the toolbar)
4. Quit the running project
5. Choose a particular feature of the project to examine (eg. clicking a button displays a picture)
6. Examine the code and comments in any objects that you think might be related to the feature (eg. a pushbutton, a canvas, a window, etc.) to figure out how the program feature works.
NOTE: Many windows have a “Notes” section available when you click the window’s disclosure triangle. Be sure to check for any notes in the windows of an example project.