SlideShare a Scribd company logo
CHAPTER
SIX
WHAT IS NEW IN RING 1.3?
In this chapter we will learn about the changes and new features in Ring 1.3 release.
6.1 List of changes and new features
Ring 1.3 comes with many new features
• Better RingQt
• Better Ring Notepad
• Ring mode for Emacs Editor
• Better StdLib
• Better Loop/Exit Command
• New Functions
• Return Self by Reference
• Using ‘<’ and ‘:’ operators as ‘from’ keyword
• Embedding Ring in Ring without sharing the State
• RingZip Library
• Form Designer
6.2 Better RingQt
(1) Another version of QPixMap class is added (QPixMap2) which takes (int width,int height) during object init.
Example:
Load "guilib.ring"
New qapp
{
win1 = new qwidget()
{
setwindowtitle("Drawing using QPixMap")
setgeometry(100,100,500,500)
label1 = new qlabel(win1)
{
setgeometry(10,10,400,400)
settext("")
85
Ring Documentation, Release 1.5.2
}
imageStock = new qlabel(win1)
{
image = new qPixMap2(200,200)
color = new qcolor() {
setrgb(255,255,255,255)
}
pen = new qpen() {
setcolor(color)
setwidth(10)
}
new qpainter() {
begin(image)
setpen(pen)
drawline(0,0,200,200)
drawline(200,0,0,200)
endpaint()
}
setpixmap(image)
}
show()
}
exec()
}
Screen Shot:
6.2. Better RingQt 86
Ring Documentation, Release 1.5.2
2. The Objects Library is updated to include the next functions
• Last_WindowID()
• Open_WindowNoShow()
• Open_WindowAndLink()
Also the class name (WindowViewBase) is changed to (WindowsViewParent).
In The next code for example the Open_WindowAndLink() will create an object from the SecondWindowController
Class Then will add the Method SecondWindow() to the FirstWindowController Class Also will add the Method
FirstWindow() to the SecondWindowController Class
So the SendMessage() method in FirstWindowController class can use the SecondWindow() method to access the
object.
class firstwindowController from windowsControllerParent
oView = new firstwindowView
func OpenSecondWindow
Open_WindowAndLink(:SecondWindowController,self)
6.2. Better RingQt 87
Ring Documentation, Release 1.5.2
func SendMessage
if IsSecondWindow()
SecondWindow().setMessage("Message from the first window")
ok
func setMessage cMessage
oView.Label1.setText(cMessage)
3. The next classes are added to RingQt
• QPixMap2
• QScrollArea
• QSplitter
• QCompleter
• QCompleter2
• QCompleter3
• QProcess
• QMdiArea
• QMdiSubWindow
• QCursor
• QListView
• QDesktopServices
4. Many constants are defined in qt.rh (loaded by guilib.ring)
5. New Classes names - Index Start from 1
We added new classes to RingQt - another version of classes where the class names doesn’t start with the “q” letter
Also updated methods so the index start from 1 when we deal with the GUI controls like
• ComboBox
• ListWidget
• TableWidget
• TreeWidget
These classes are inside guilib.ring under the package name : System.GUI
To use it
load "guilib.ring"
import System.GUI
This doesn’t have any effect on our previous code, It’s just another choice for better code that is consistent with Ring
rules.
Also the form designer is updated to provide us the choice between using classes where (index start from 0) or (index
start from 1)
Example (Uses the Form Designer)
1. https://github.com/ring-lang/ring/blob/master/applications/formdesigner/tests/indexstart/indexstartView.ring
6.2. Better RingQt 88
Ring Documentation, Release 1.5.2
2. https://github.com/ring-lang/ring/blob/master/applications/formdesigner/tests/indexstart/indexstartController.ring
6.3 Better Ring Notepad
1. Using QPlainTextEdit instead of QTextEdit
2. Displaying the line number for each line in the source code file.
Screen Shot:
3. Auto-Complete for Ring functions names, classes and words in the opened file.
6.3. Better Ring Notepad 89
Ring Documentation, Release 1.5.2
4. Functions and Methods List
6.3. Better Ring Notepad 90
Ring Documentation, Release 1.5.2
5. Output Window
6. Classes List
6.3. Better Ring Notepad 91
Ring Documentation, Release 1.5.2
7. Change the Current Style
6.4 Ring mode for Emacs Editor
Ring 1.3 comes with Ring mode for Emacs Editor
Screen Shot:
6.4. Ring mode for Emacs Editor 92
Ring Documentation, Release 1.5.2
6.5 Better StdLib
The StdLib is updated to include the next functions
• SplitMany()
• JustFilePath()
• JustFileName()
6.6 Better Loop|Exit Command
The Loop|Exit command is updated to accept Expressions after the command (not only numbers).
The syntax:
Loop|Exit [Number]
Changed to
Loop|Exit [Expression]
Example
XLoop = 2 # The outer loop
YLoop = 1 # The first inner loop
for x = 1 to 10
for y = 1 to 10
see "x=" + x + " y=" + y + nl
if x = 3 and y = 5
exit XLoop
ok
6.5. Better StdLib 93
Ring Documentation, Release 1.5.2
next
next
6.7 New Functions
• PackageName() function
• Swap() function
Example:
aList = [:one,:two,:four,:three]
see aList
see copy("*",50) + nl
swap(aList,3,4)
see aList
Output
one
two
four
three
**************************************************
one
two
three
four
6.8 Return Self by Reference
In this release, using Return Self in class methods will return the object by reference.
Example:
mylist = [new mytest() {
see self
x = 20
see self
}]
see mylist
class mytest
x = 15
func init
return self # Return by reference
Output
x: 15.000000
x: 20.000000
x: 20.000000
6.7. New Functions 94

More Related Content

PDF
The Ring programming language version 1.5.4 book - Part 13 of 185
PDF
The Ring programming language version 1.5.1 book - Part 11 of 180
PDF
The Ring programming language version 1.6 book - Part 14 of 189
PDF
The Ring programming language version 1.7 book - Part 15 of 196
PDF
The Ring programming language version 1.8 book - Part 10 of 202
PDF
The Ring programming language version 1.7 book - Part 9 of 196
PDF
The Ring programming language version 1.9 book - Part 10 of 210
PDF
The Ring programming language version 1.10 book - Part 11 of 212
The Ring programming language version 1.5.4 book - Part 13 of 185
The Ring programming language version 1.5.1 book - Part 11 of 180
The Ring programming language version 1.6 book - Part 14 of 189
The Ring programming language version 1.7 book - Part 15 of 196
The Ring programming language version 1.8 book - Part 10 of 202
The Ring programming language version 1.7 book - Part 9 of 196
The Ring programming language version 1.9 book - Part 10 of 210
The Ring programming language version 1.10 book - Part 11 of 212

What's hot (20)

PDF
The Ring programming language version 1.9 book - Part 12 of 210
PDF
The Ring programming language version 1.10 book - Part 13 of 212
PDF
The Ring programming language version 1.3 book - Part 7 of 88
PDF
The Ring programming language version 1.9 book - Part 17 of 210
PDF
The Ring programming language version 1.9 book - Part 33 of 210
PDF
The Ring programming language version 1.5.3 book - Part 11 of 184
PDF
The Ring programming language version 1.8 book - Part 15 of 202
PDF
The Ring programming language version 1.7 book - Part 8 of 196
PDF
Lightining Talk - Task queue and micro task queues in browser
PDF
The Ring programming language version 1.9 book - Part 9 of 210
PDF
The Ring programming language version 1.10 book - Part 10 of 212
PDF
The Ring programming language version 1.5.4 book - Part 26 of 185
PDF
The Ring programming language version 1.8 book - Part 14 of 202
PDF
The Ring programming language version 1.8 book - Part 9 of 202
PDF
The Ring programming language version 1.5.1 book - Part 6 of 180
PDF
The Ring programming language version 1.9 book - Part 16 of 210
PDF
The Ring programming language version 1.6 book - Part 41 of 189
PDF
The Ring programming language version 1.6 book - Part 7 of 189
PDF
The Ring programming language version 1.5.4 book - Part 70 of 185
PDF
Dagger & rxjava & retrofit
The Ring programming language version 1.9 book - Part 12 of 210
The Ring programming language version 1.10 book - Part 13 of 212
The Ring programming language version 1.3 book - Part 7 of 88
The Ring programming language version 1.9 book - Part 17 of 210
The Ring programming language version 1.9 book - Part 33 of 210
The Ring programming language version 1.5.3 book - Part 11 of 184
The Ring programming language version 1.8 book - Part 15 of 202
The Ring programming language version 1.7 book - Part 8 of 196
Lightining Talk - Task queue and micro task queues in browser
The Ring programming language version 1.9 book - Part 9 of 210
The Ring programming language version 1.10 book - Part 10 of 212
The Ring programming language version 1.5.4 book - Part 26 of 185
The Ring programming language version 1.8 book - Part 14 of 202
The Ring programming language version 1.8 book - Part 9 of 202
The Ring programming language version 1.5.1 book - Part 6 of 180
The Ring programming language version 1.9 book - Part 16 of 210
The Ring programming language version 1.6 book - Part 41 of 189
The Ring programming language version 1.6 book - Part 7 of 189
The Ring programming language version 1.5.4 book - Part 70 of 185
Dagger & rxjava & retrofit
Ad

Similar to The Ring programming language version 1.5.2 book - Part 12 of 181 (20)

PDF
The Ring programming language version 1.4.1 book - Part 3 of 31
PDF
The Ring programming language version 1.4 book - Part 3 of 30
PDF
The Ring programming language version 1.5.3 book - Part 13 of 184
PDF
The Ring programming language version 1.8 book - Part 17 of 202
PDF
The Ring programming language version 1.5.3 book - Part 12 of 184
PDF
The Ring programming language version 1.5.1 book - Part 12 of 180
PDF
The Ring programming language version 1.8 book - Part 16 of 202
PDF
The Ring programming language version 1.5.4 book - Part 14 of 185
PDF
The Ring programming language version 1.9 book - Part 19 of 210
PDF
The Ring programming language version 1.10 book - Part 20 of 212
PDF
The Ring programming language version 1.6 book - Part 15 of 189
PDF
The Ring programming language version 1.10 book - Part 21 of 212
PDF
The Ring programming language version 1.9 book - Part 18 of 210
PDF
The Ring programming language version 1.6 book - Part 8 of 189
PDF
The Ring programming language version 1.3 book - Part 6 of 88
PDF
The Ring programming language version 1.7 book - Part 16 of 196
PDF
The Ring programming language version 1.5.2 book - Part 13 of 181
PDF
The Ring programming language version 1.10 book - Part 18 of 212
PDF
The Ring programming language version 1.6 book - Part 12 of 189
PDF
The Ring programming language version 1.7 book - Part 13 of 196
The Ring programming language version 1.4.1 book - Part 3 of 31
The Ring programming language version 1.4 book - Part 3 of 30
The Ring programming language version 1.5.3 book - Part 13 of 184
The Ring programming language version 1.8 book - Part 17 of 202
The Ring programming language version 1.5.3 book - Part 12 of 184
The Ring programming language version 1.5.1 book - Part 12 of 180
The Ring programming language version 1.8 book - Part 16 of 202
The Ring programming language version 1.5.4 book - Part 14 of 185
The Ring programming language version 1.9 book - Part 19 of 210
The Ring programming language version 1.10 book - Part 20 of 212
The Ring programming language version 1.6 book - Part 15 of 189
The Ring programming language version 1.10 book - Part 21 of 212
The Ring programming language version 1.9 book - Part 18 of 210
The Ring programming language version 1.6 book - Part 8 of 189
The Ring programming language version 1.3 book - Part 6 of 88
The Ring programming language version 1.7 book - Part 16 of 196
The Ring programming language version 1.5.2 book - Part 13 of 181
The Ring programming language version 1.10 book - Part 18 of 212
The Ring programming language version 1.6 book - Part 12 of 189
The Ring programming language version 1.7 book - Part 13 of 196
Ad

More from Mahmoud Samir Fayed (20)

PDF
The Ring programming language version 1.10 book - Part 212 of 212
PDF
The Ring programming language version 1.10 book - Part 211 of 212
PDF
The Ring programming language version 1.10 book - Part 210 of 212
PDF
The Ring programming language version 1.10 book - Part 208 of 212
PDF
The Ring programming language version 1.10 book - Part 207 of 212
PDF
The Ring programming language version 1.10 book - Part 205 of 212
PDF
The Ring programming language version 1.10 book - Part 206 of 212
PDF
The Ring programming language version 1.10 book - Part 204 of 212
PDF
The Ring programming language version 1.10 book - Part 203 of 212
PDF
The Ring programming language version 1.10 book - Part 202 of 212
PDF
The Ring programming language version 1.10 book - Part 201 of 212
PDF
The Ring programming language version 1.10 book - Part 200 of 212
PDF
The Ring programming language version 1.10 book - Part 199 of 212
PDF
The Ring programming language version 1.10 book - Part 198 of 212
PDF
The Ring programming language version 1.10 book - Part 197 of 212
PDF
The Ring programming language version 1.10 book - Part 196 of 212
PDF
The Ring programming language version 1.10 book - Part 195 of 212
PDF
The Ring programming language version 1.10 book - Part 194 of 212
PDF
The Ring programming language version 1.10 book - Part 193 of 212
PDF
The Ring programming language version 1.10 book - Part 192 of 212
The Ring programming language version 1.10 book - Part 212 of 212
The Ring programming language version 1.10 book - Part 211 of 212
The Ring programming language version 1.10 book - Part 210 of 212
The Ring programming language version 1.10 book - Part 208 of 212
The Ring programming language version 1.10 book - Part 207 of 212
The Ring programming language version 1.10 book - Part 205 of 212
The Ring programming language version 1.10 book - Part 206 of 212
The Ring programming language version 1.10 book - Part 204 of 212
The Ring programming language version 1.10 book - Part 203 of 212
The Ring programming language version 1.10 book - Part 202 of 212
The Ring programming language version 1.10 book - Part 201 of 212
The Ring programming language version 1.10 book - Part 200 of 212
The Ring programming language version 1.10 book - Part 199 of 212
The Ring programming language version 1.10 book - Part 198 of 212
The Ring programming language version 1.10 book - Part 197 of 212
The Ring programming language version 1.10 book - Part 196 of 212
The Ring programming language version 1.10 book - Part 195 of 212
The Ring programming language version 1.10 book - Part 194 of 212
The Ring programming language version 1.10 book - Part 193 of 212
The Ring programming language version 1.10 book - Part 192 of 212

Recently uploaded (20)

PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Electronic commerce courselecture one. Pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
MYSQL Presentation for SQL database connectivity
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Empathic Computing: Creating Shared Understanding
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
cuic standard and advanced reporting.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Cloud computing and distributed systems.
PDF
Machine learning based COVID-19 study performance prediction
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Encapsulation theory and applications.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
The Rise and Fall of 3GPP – Time for a Sabbatical?
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Review of recent advances in non-invasive hemoglobin estimation
Electronic commerce courselecture one. Pdf
Big Data Technologies - Introduction.pptx
Chapter 3 Spatial Domain Image Processing.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
MYSQL Presentation for SQL database connectivity
NewMind AI Weekly Chronicles - August'25 Week I
Dropbox Q2 2025 Financial Results & Investor Presentation
Empathic Computing: Creating Shared Understanding
Spectral efficient network and resource selection model in 5G networks
cuic standard and advanced reporting.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Cloud computing and distributed systems.
Machine learning based COVID-19 study performance prediction
Unlocking AI with Model Context Protocol (MCP)
Encapsulation theory and applications.pdf

The Ring programming language version 1.5.2 book - Part 12 of 181

  • 1. CHAPTER SIX WHAT IS NEW IN RING 1.3? In this chapter we will learn about the changes and new features in Ring 1.3 release. 6.1 List of changes and new features Ring 1.3 comes with many new features • Better RingQt • Better Ring Notepad • Ring mode for Emacs Editor • Better StdLib • Better Loop/Exit Command • New Functions • Return Self by Reference • Using ‘<’ and ‘:’ operators as ‘from’ keyword • Embedding Ring in Ring without sharing the State • RingZip Library • Form Designer 6.2 Better RingQt (1) Another version of QPixMap class is added (QPixMap2) which takes (int width,int height) during object init. Example: Load "guilib.ring" New qapp { win1 = new qwidget() { setwindowtitle("Drawing using QPixMap") setgeometry(100,100,500,500) label1 = new qlabel(win1) { setgeometry(10,10,400,400) settext("") 85
  • 2. Ring Documentation, Release 1.5.2 } imageStock = new qlabel(win1) { image = new qPixMap2(200,200) color = new qcolor() { setrgb(255,255,255,255) } pen = new qpen() { setcolor(color) setwidth(10) } new qpainter() { begin(image) setpen(pen) drawline(0,0,200,200) drawline(200,0,0,200) endpaint() } setpixmap(image) } show() } exec() } Screen Shot: 6.2. Better RingQt 86
  • 3. Ring Documentation, Release 1.5.2 2. The Objects Library is updated to include the next functions • Last_WindowID() • Open_WindowNoShow() • Open_WindowAndLink() Also the class name (WindowViewBase) is changed to (WindowsViewParent). In The next code for example the Open_WindowAndLink() will create an object from the SecondWindowController Class Then will add the Method SecondWindow() to the FirstWindowController Class Also will add the Method FirstWindow() to the SecondWindowController Class So the SendMessage() method in FirstWindowController class can use the SecondWindow() method to access the object. class firstwindowController from windowsControllerParent oView = new firstwindowView func OpenSecondWindow Open_WindowAndLink(:SecondWindowController,self) 6.2. Better RingQt 87
  • 4. Ring Documentation, Release 1.5.2 func SendMessage if IsSecondWindow() SecondWindow().setMessage("Message from the first window") ok func setMessage cMessage oView.Label1.setText(cMessage) 3. The next classes are added to RingQt • QPixMap2 • QScrollArea • QSplitter • QCompleter • QCompleter2 • QCompleter3 • QProcess • QMdiArea • QMdiSubWindow • QCursor • QListView • QDesktopServices 4. Many constants are defined in qt.rh (loaded by guilib.ring) 5. New Classes names - Index Start from 1 We added new classes to RingQt - another version of classes where the class names doesn’t start with the “q” letter Also updated methods so the index start from 1 when we deal with the GUI controls like • ComboBox • ListWidget • TableWidget • TreeWidget These classes are inside guilib.ring under the package name : System.GUI To use it load "guilib.ring" import System.GUI This doesn’t have any effect on our previous code, It’s just another choice for better code that is consistent with Ring rules. Also the form designer is updated to provide us the choice between using classes where (index start from 0) or (index start from 1) Example (Uses the Form Designer) 1. https://github.com/ring-lang/ring/blob/master/applications/formdesigner/tests/indexstart/indexstartView.ring 6.2. Better RingQt 88
  • 5. Ring Documentation, Release 1.5.2 2. https://github.com/ring-lang/ring/blob/master/applications/formdesigner/tests/indexstart/indexstartController.ring 6.3 Better Ring Notepad 1. Using QPlainTextEdit instead of QTextEdit 2. Displaying the line number for each line in the source code file. Screen Shot: 3. Auto-Complete for Ring functions names, classes and words in the opened file. 6.3. Better Ring Notepad 89
  • 6. Ring Documentation, Release 1.5.2 4. Functions and Methods List 6.3. Better Ring Notepad 90
  • 7. Ring Documentation, Release 1.5.2 5. Output Window 6. Classes List 6.3. Better Ring Notepad 91
  • 8. Ring Documentation, Release 1.5.2 7. Change the Current Style 6.4 Ring mode for Emacs Editor Ring 1.3 comes with Ring mode for Emacs Editor Screen Shot: 6.4. Ring mode for Emacs Editor 92
  • 9. Ring Documentation, Release 1.5.2 6.5 Better StdLib The StdLib is updated to include the next functions • SplitMany() • JustFilePath() • JustFileName() 6.6 Better Loop|Exit Command The Loop|Exit command is updated to accept Expressions after the command (not only numbers). The syntax: Loop|Exit [Number] Changed to Loop|Exit [Expression] Example XLoop = 2 # The outer loop YLoop = 1 # The first inner loop for x = 1 to 10 for y = 1 to 10 see "x=" + x + " y=" + y + nl if x = 3 and y = 5 exit XLoop ok 6.5. Better StdLib 93
  • 10. Ring Documentation, Release 1.5.2 next next 6.7 New Functions • PackageName() function • Swap() function Example: aList = [:one,:two,:four,:three] see aList see copy("*",50) + nl swap(aList,3,4) see aList Output one two four three ************************************************** one two three four 6.8 Return Self by Reference In this release, using Return Self in class methods will return the object by reference. Example: mylist = [new mytest() { see self x = 20 see self }] see mylist class mytest x = 15 func init return self # Return by reference Output x: 15.000000 x: 20.000000 x: 20.000000 6.7. New Functions 94