Professional Documents
Culture Documents
ELEVEN
In this chapter we will learn about using Ring Notepad to write and execute Ring programs quickly
Ring Notepad is just a simple application developed using the Ring language.
50
Ring Documentation, Release 1.2
Then we will click on the Save button from the toolbar (or press CTRL+S)
To run the program click on Debug (Run then wait!) button from the toolbar
The next screen shot present the application during the runtime
Press Enter to continue and return to the Ring Notepad.
To learn how to create GUI applications using Ring check the Desktop and Mobile development using RingQt
chapter.
Source Code:
Load "guilib.ring"
New qApp {
new qWidget() {
resize(400,400)
setWindowTitle("Hello, World!")
show()
}
exec()
}
In Ring notepad we have a special button to run GUI applications without displaying the console window.
The next screen shot present the application during the runtime
To learn how support Ring in your web server and how to create web applications using Ring check the Web Devel-
opment (CGI Library) chapter.
Note: You need to support the Ring language in your web server to be able to run the next example.
Source Code:
#!b:\ring\bin\ring.exe -cgi
load "weblib.ring"
Import System.Web
new page {
text("Hello, World!")
We can run the application in any web browser or in the browser that are embedded in Ring Notepad.
To learn about creating 2D Games using Ring check the Demo Project - Game Engine for 2D Games chapter.
Source Code:
Load "gameengine.ring"
func main
Move=true
Scaled=true
}
}
TWELVE
In the Ring/Editor folder you will find extensions for the next editors
Notepad++
Geany
Atom
Sublime Text 2
Visual Studio IDE
Folder : ring/editor/notepad_plus_plus
Open Notepad++
Open the Language menu
Select Define your language...
Click Import...
select Ring.xml
Select OK on the Import successful dialog and close the User Defined Language dialog/panel
You may need to restart notepad++
57
Ring Documentation, Release 1.2
Folder : ring/editor/geany
Run Geany editor
Click on Tools -> configuration files -> filetypes_extensions.conf menu
Add this line Ring=*.ring; without quotes after [Extensions]
In unbuntu copy file filetypes.Ring.conf to folder /home/USERNAME/filetypes.Ring.conf
You can run your files by pressing F5 button
Folder : ring/editor/atom
Just Copy the folder atom-language-ring to the next path C:Users{UserName}.atomPackages