The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
ย
The Ring programming language version 1.10 book - Part 25 of 212
1. Ring Documentation, Release 1.10
19.3 Creating and running your ๏ฌrst GUI/Mobile Application
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.
19.3. Creating and running your ๏ฌrst GUI/Mobile Application 208
2. Ring Documentation, Release 1.10
The next screen shot present the application during the runtime
19.4 Creating and running your ๏ฌrst Web Application
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:
#!ring -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.
19.4. Creating and running your ๏ฌrst Web Application 209
3. Ring Documentation, Release 1.10
For Windows users, Ring comes with Apache Web server!
We can run any web application from any folder directly without doing any con๏ฌguration.
19.5 Creating and running your ๏ฌrst Desktop/Mobile Game
To learn about creating 2D Games using Ring check the โDemo Project - Game Engine for 2D Gamesโ chapter.
Source Code:
19.5. Creating and running your ๏ฌrst Desktop/Mobile Game 210
4. Ring Documentation, Release 1.10
Load "gameengine.ring"
func main
oGame = New Game
{
title = "My First Game"
sprite
{
type = GE_TYPE_PLAYER
x=400 y=400 width=100 height=100
file = "images/player.png"
transparent = true
Animate=false
Move=true
Scaled=true
}
}
We can run the application as any GUI application.
19.6 The Main File in the Project
The idea of the Main File ToolBar is to determine the main ๏ฌle in the project When the project contains many source
code ๏ฌles
Using this feature we can run the project (Main File) at any time while opening other ๏ฌles in the project without the
need to switch to the Main File to run the project.
To quickly use this feature
(Open the project main ๏ฌle)
Press Ctrl+Shift+M to set the current source code ๏ฌle as the main ๏ฌle
19.6. The Main File in the Project 211
5. Ring Documentation, Release 1.10
Open and modify other source code ๏ฌles in the project
To run the project (Main File) at any time press Ctrl+Shift+F5 (GUI) or Ctrl+Shift+D (Console)
Screen Shots:
19.7 The File Menu
From this menu we can create, open and save the source code ๏ฌles.
Another feature in this menu is โPrint to PDFโ
19.7. The File Menu 212
6. Ring Documentation, Release 1.10
19.8 The Edit Menu
From the Edit menu we can Cut, Copy and Paste text.
Also we can change the font and the colors.
We can Go to a speci๏ฌc line or use the Find and Replace window to ๏ฌnd and replace text.
Also We can set the Tab Width (Number of Spaces)
Starting from Ring 1.8 we have the (Find in Files) option.
19.9 The View Menu
From this menu we can show/hide the dockable windows
Also we can change the Style of the Ring Notepad
Common Styles are (Fusion White and Modern Black)
19.8. The Edit Menu 213
7. Ring Documentation, Release 1.10
Also we can quickly show/hide group of dockable windows based on the context
19.9. The View Menu 214
8. Ring Documentation, Release 1.10
19.10 The Program Menu
From this menu we can run the programs
Also we can set the Main ๏ฌle in the project
19.11 The Browser Menu
From this menu we can quickly open common links in the browser
19.10. The Program Menu 215
9. Ring Documentation, Release 1.10
19.12 The Tools Menu
From this menu we can run the Form Designer in separate window
Also we can run the REPL (Read-Eval-Print-Loop) application
19.13 The Distribute Menu
From this menu we can build an executable ๏ฌle for the application
Also we can prepare the application for distribution
19.12. The Tools Menu 216
10. Ring Documentation, Release 1.10
19.14 The Help Menu
From this menu we can get the help ๏ฌles (CHM & PDF)
19.14. The Help Menu 217