SlideShare a Scribd company logo
Ring Documentation, Release 1.3
on 5
oGame.aObjects[2].aMap[nRow][nCol] = 0
oGameState.DoorKey = true
oGameState.Score += 500
checkopenwall(oGame)
oGame { Sound {
once = true
file = "sound/sfx_point.wav"
} }
off
func checkstarskeycol oGame,oSelf
nValue = oGame.aObjects[2].getvalue(oSelf.x,oSelf.y)
nRow = oGame.aObjects[2].getrow(oSelf.x,oSelf.y)
nCol = oGame.aObjects[2].getcol(oSelf.x,oSelf.y)
checkstarskey(oGame,oSelf,nValue,nRow,nCol)
nValue = oGame.aObjects[2].getvalue(oSelf.x+oSelf.width,oSelf.y+oSelf.height)
nRow = oGame.aObjects[2].getrow(oSelf.x+oSelf.width,oSelf.y+oSelf.height)
nCol = oGame.aObjects[2].getcol(oSelf.x+oSelf.width,oSelf.y+oSelf.height)
checkstarskey(oGame,oSelf,nValue,nRow,nCol)
nValue = oGame.aObjects[2].getvalue(oSelf.x+oSelf.width,oSelf.y)
nRow = oGame.aObjects[2].getrow(oSelf.x+oSelf.width,oSelf.y)
nCol = oGame.aObjects[2].getcol(oSelf.x+oSelf.width,oSelf.y)
checkstarskey(oGame,oSelf,nValue,nRow,nCol)
nValue = oGame.aObjects[2].getvalue(oSelf.x,oSelf.y+oSelf.height)
nRow = oGame.aObjects[2].getrow(oSelf.x,oSelf.y+oSelf.height)
nCol = oGame.aObjects[2].getcol(oSelf.x,oSelf.y+oSelf.height)
checkstarskey(oGame,oSelf,nValue,nRow,nCol)
func callenemystate oGame
for t in oGame.aObjects
t {
if type = GE_TYPE_ENEMY
call state(oGame,t)
ok
}
next
Class GameState
down = 3
gameresult = false
Score = 0
startplay=false
lastcol = 0
playerwin = false
DoorKey = false
playerindex = 4
value = 1000
moveplayer = false
Screen Shot:
47.29. Super Man 2016 Game 398
Ring Documentation, Release 1.3
47.29. Super Man 2016 Game 399
CHAPTER
FORTYEIGHT
BUILDING GAMES FOR ANDROID
In this chapter we will learn about Building RingLibSDL Games for Mobile.
So we can create packages (*.apk) for the applications that are developed using Ring Game Engine for 2D Games.
48.1 Download Requirements and Update the Android SDK
• The Android SDK Tools
https://developer.android.com/studio/index.html
• The Android NDK
https://developer.android.com/ndk/index.html
• Apache Ant v1.8 or later
http://ant.apache.org/bindownload.cgi
• Java SE Development Kit (JDK) v6 or later
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
• Update the Android SDK to get the API and tools packages required for development
48.2 Project Folder
Open the project folder : ring/android/ringlibsdl/project
400
Ring Documentation, Release 1.3
You can add the source code (*.ring) and Images/Sound Files to the assets folder.
You will find the Flappy Bird 3000 Game ready for building.
The execution starts from the start.ring file
load "game2.ring"
48.3 Building the project
Move to the ring/android/ringlibsdl/project folder
We can build using the next command (We need to do this for one time only).
ndk-build
Then we can create the package (*.apk) using the next command.
48.3. Building the project 401
Ring Documentation, Release 1.3
ant debug
48.3. Building the project 402
CHAPTER
FORTYNINE
DESKTOP AND MOBILE DEVELOPMENT USING RINGQT
In this chapter we will learn how to use the Qt framework classes in our Ring applications to create Desktop and
Mobile Applications.
49.1 The First GUI Application
In this example we will create an application to ask the user about his/her name. When the user type the name in the
textbox then click on “Say Hello” button, the textbox value will be updated by adding “Hello ” to the name.
Load "guilib.ring"
MyApp = New qApp {
win1 = new qWidget() {
setwindowtitle("Hello World")
setGeometry(100,100,370,250)
label1 = new qLabel(win1) {
settext("What is your name ?")
setGeometry(10,20,350,30)
setalignment(Qt_AlignHCenter)
}
btn1 = new qpushbutton(win1) {
setGeometry(10,200,100,30)
settext("Say Hello")
setclickevent("pHello()")
}
btn1 = new qpushbutton(win1) {
setGeometry(150,200,100,30)
settext("Close")
setclickevent("pClose()")
}
lineedit1 = new qlineedit(win1) {
setGeometry(10,100,350,30)
}
show()
}
403
Ring Documentation, Release 1.3
exec()
}
Func pHello
lineedit1.settext( "Hello " + lineedit1.text())
Func pClose
MyApp.quit()
Program Output:
At first we type the name in the textbox
Then we click on the say hello button
49.1. The First GUI Application 404
Ring Documentation, Release 1.3
49.2 Using Layout
The next example is just an upgrade to the previous application to use the vertical layout.
Load "guilib.ring"
MyApp = New qApp {
win1 = new qWidget() {
setwindowtitle("Hello World")
setGeometry(100,100,400,130)
label1 = new qLabel(win1) {
settext("What is your name ?")
setGeometry(10,20,350,30)
setalignment(Qt_AlignHCenter)
}
btn1 = new qpushbutton(win1) {
setGeometry(10,200,100,30)
settext("Say Hello")
setclickevent("pHello()")
}
btn2 = new qpushbutton(win1) {
setGeometry(150,200,100,30)
settext("Close")
setclickevent("pClose()")
}
lineedit1 = new qlineedit(win1) {
setGeometry(10,100,350,30)
}
layout1 = new qVBoxLayout() {
addwidget(label1)
addwidget(lineedit1)
addwidget(btn1)
addwidget(btn2)
}
win1.setlayout(layout1)
show()
}
exec()
}
Func pHello
lineedit1.settext( "Hello " + lineedit1.text())
Func pClose
MyApp.quit()
The application during the runtime!
49.2. Using Layout 405
Ring Documentation, Release 1.3
49.3 Using the QTextEdit Class
In this example we will use the QTextEdit Class
Load "guilib.ring"
New qApp {
win1 = new qWidget() {
setwindowtitle("QTextEdit Class")
setGeometry(100,100,500,500)
new qtextedit(win1) {
setGeometry(10,10,480,480)
}
show()
}
exec()
}
During the runtime we can paste rich text in the qtextedit widget
49.3. Using the QTextEdit Class 406
Ring Documentation, Release 1.3
49.4 Using the QListWidget Class
In this example we will use the QListWidget Class
Load "guilib.ring"
New qApp {
win1 = new qWidget() {
setGeometry(100,100,400,400)
list1 = new qlistwidget(win1) {
setGeometry(150,100,200,200)
alist = ["one","two","three","four","five"]
for x in alist additem(x) next
setcurrentrow(3,2)
win1.setwindowtitle("Items Count : " + count() )
}
49.4. Using the QListWidget Class 407

More Related Content

PDF
The Ring programming language version 1.5.1 book - Part 57 of 180
PDF
The Ring programming language version 1.5.4 book - Part 65 of 185
PDF
The Ring programming language version 1.3 book - Part 52 of 88
PDF
The Ring programming language version 1.3 book - Part 49 of 88
PDF
The Ring programming language version 1.5.1 book - Part 60 of 180
PDF
The Ring programming language version 1.2 book - Part 41 of 84
PDF
The Ring programming language version 1.5.2 book - Part 66 of 181
PDF
The Ring programming language version 1.9 book - Part 77 of 210
The Ring programming language version 1.5.1 book - Part 57 of 180
The Ring programming language version 1.5.4 book - Part 65 of 185
The Ring programming language version 1.3 book - Part 52 of 88
The Ring programming language version 1.3 book - Part 49 of 88
The Ring programming language version 1.5.1 book - Part 60 of 180
The Ring programming language version 1.2 book - Part 41 of 84
The Ring programming language version 1.5.2 book - Part 66 of 181
The Ring programming language version 1.9 book - Part 77 of 210

What's hot (20)

PDF
The Ring programming language version 1.8 book - Part 53 of 202
PDF
The Ring programming language version 1.3 book - Part 40 of 88
PDF
The Ring programming language version 1.2 book - Part 46 of 84
PDF
The Ring programming language version 1.6 book - Part 66 of 189
PDF
The Ring programming language version 1.7 book - Part 67 of 196
PDF
The Ring programming language version 1.2 book - Part 48 of 84
PDF
The Ring programming language version 1.6 book - Part 52 of 189
PDF
The Ring programming language version 1.5.2 book - Part 62 of 181
PDF
The Ring programming language version 1.7 book - Part 65 of 196
PDF
The Ring programming language version 1.5.2 book - Part 63 of 181
PDF
The Ring programming language version 1.10 book - Part 61 of 212
PDF
The Ring programming language version 1.5.2 book - Part 60 of 181
PDF
The Ring programming language version 1.7 book - Part 71 of 196
PDF
The Ring programming language version 1.5.2 book - Part 52 of 181
PDF
The Ring programming language version 1.5.3 book - Part 70 of 184
PDF
The Ring programming language version 1.2 book - Part 47 of 84
PDF
The Ring programming language version 1.5.2 book - Part 49 of 181
PDF
The Ring programming language version 1.3 book - Part 48 of 88
PDF
The Ring programming language version 1.5.4 book - Part 50 of 185
PDF
The Ring programming language version 1.9 book - Part 60 of 210
The Ring programming language version 1.8 book - Part 53 of 202
The Ring programming language version 1.3 book - Part 40 of 88
The Ring programming language version 1.2 book - Part 46 of 84
The Ring programming language version 1.6 book - Part 66 of 189
The Ring programming language version 1.7 book - Part 67 of 196
The Ring programming language version 1.2 book - Part 48 of 84
The Ring programming language version 1.6 book - Part 52 of 189
The Ring programming language version 1.5.2 book - Part 62 of 181
The Ring programming language version 1.7 book - Part 65 of 196
The Ring programming language version 1.5.2 book - Part 63 of 181
The Ring programming language version 1.10 book - Part 61 of 212
The Ring programming language version 1.5.2 book - Part 60 of 181
The Ring programming language version 1.7 book - Part 71 of 196
The Ring programming language version 1.5.2 book - Part 52 of 181
The Ring programming language version 1.5.3 book - Part 70 of 184
The Ring programming language version 1.2 book - Part 47 of 84
The Ring programming language version 1.5.2 book - Part 49 of 181
The Ring programming language version 1.3 book - Part 48 of 88
The Ring programming language version 1.5.4 book - Part 50 of 185
The Ring programming language version 1.9 book - Part 60 of 210
Ad

Similar to The Ring programming language version 1.3 book - Part 43 of 88 (20)

PDF
The Ring programming language version 1.4.1 book - Part 16 of 31
PDF
The Ring programming language version 1.10 book - Part 72 of 212
PDF
The Ring programming language version 1.5.3 book - Part 79 of 184
PDF
The Ring programming language version 1.8 book - Part 67 of 202
PDF
The Ring programming language version 1.9 book - Part 63 of 210
PDF
The Ring programming language version 1.9 book - Part 71 of 210
PDF
The Ring programming language version 1.5.4 book - Part 60 of 185
PDF
The Ring programming language version 1.2 book - Part 82 of 84
PDF
The Ring programming language version 1.5.4 book - Part 67 of 185
PDF
The Ring programming language version 1.6 book - Part 69 of 189
PDF
The Ring programming language version 1.5.4 book - Part 69 of 185
PDF
The Ring programming language version 1.5.1 book - Part 63 of 180
PDF
The Ring programming language version 1.6 book - Part 19 of 189
PDF
The Ring programming language version 1.6 book - Part 62 of 189
PDF
The Ring programming language version 1.2 book - Part 79 of 84
PDF
The Ring programming language version 1.5.2 book - Part 64 of 181
PDF
The Ring programming language version 1.10 book - Part 25 of 212
PDF
The Ring programming language version 1.6 book - Part 63 of 189
PDF
The Ring programming language version 1.10 book - Part 73 of 212
PDF
The Ring programming language version 1.2 book - Part 51 of 84
The Ring programming language version 1.4.1 book - Part 16 of 31
The Ring programming language version 1.10 book - Part 72 of 212
The Ring programming language version 1.5.3 book - Part 79 of 184
The Ring programming language version 1.8 book - Part 67 of 202
The Ring programming language version 1.9 book - Part 63 of 210
The Ring programming language version 1.9 book - Part 71 of 210
The Ring programming language version 1.5.4 book - Part 60 of 185
The Ring programming language version 1.2 book - Part 82 of 84
The Ring programming language version 1.5.4 book - Part 67 of 185
The Ring programming language version 1.6 book - Part 69 of 189
The Ring programming language version 1.5.4 book - Part 69 of 185
The Ring programming language version 1.5.1 book - Part 63 of 180
The Ring programming language version 1.6 book - Part 19 of 189
The Ring programming language version 1.6 book - Part 62 of 189
The Ring programming language version 1.2 book - Part 79 of 84
The Ring programming language version 1.5.2 book - Part 64 of 181
The Ring programming language version 1.10 book - Part 25 of 212
The Ring programming language version 1.6 book - Part 63 of 189
The Ring programming language version 1.10 book - Part 73 of 212
The Ring programming language version 1.2 book - Part 51 of 84
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)

PDF
cuic standard and advanced reporting.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Spectroscopy.pptx food analysis technology
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
Big Data Technologies - Introduction.pptx
DOCX
The AUB Centre for AI in Media Proposal.docx
PPT
Teaching material agriculture food technology
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Encapsulation theory and applications.pdf
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Electronic commerce courselecture one. Pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
cuic standard and advanced reporting.pdf
NewMind AI Weekly Chronicles - August'25 Week I
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Network Security Unit 5.pdf for BCA BBA.
Spectroscopy.pptx food analysis technology
MIND Revenue Release Quarter 2 2025 Press Release
Big Data Technologies - Introduction.pptx
The AUB Centre for AI in Media Proposal.docx
Teaching material agriculture food technology
Diabetes mellitus diagnosis method based random forest with bat algorithm
Encapsulation theory and applications.pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Review of recent advances in non-invasive hemoglobin estimation
Dropbox Q2 2025 Financial Results & Investor Presentation
sap open course for s4hana steps from ECC to s4
Electronic commerce courselecture one. Pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Mobile App Security Testing_ A Comprehensive Guide.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf

The Ring programming language version 1.3 book - Part 43 of 88

  • 1. Ring Documentation, Release 1.3 on 5 oGame.aObjects[2].aMap[nRow][nCol] = 0 oGameState.DoorKey = true oGameState.Score += 500 checkopenwall(oGame) oGame { Sound { once = true file = "sound/sfx_point.wav" } } off func checkstarskeycol oGame,oSelf nValue = oGame.aObjects[2].getvalue(oSelf.x,oSelf.y) nRow = oGame.aObjects[2].getrow(oSelf.x,oSelf.y) nCol = oGame.aObjects[2].getcol(oSelf.x,oSelf.y) checkstarskey(oGame,oSelf,nValue,nRow,nCol) nValue = oGame.aObjects[2].getvalue(oSelf.x+oSelf.width,oSelf.y+oSelf.height) nRow = oGame.aObjects[2].getrow(oSelf.x+oSelf.width,oSelf.y+oSelf.height) nCol = oGame.aObjects[2].getcol(oSelf.x+oSelf.width,oSelf.y+oSelf.height) checkstarskey(oGame,oSelf,nValue,nRow,nCol) nValue = oGame.aObjects[2].getvalue(oSelf.x+oSelf.width,oSelf.y) nRow = oGame.aObjects[2].getrow(oSelf.x+oSelf.width,oSelf.y) nCol = oGame.aObjects[2].getcol(oSelf.x+oSelf.width,oSelf.y) checkstarskey(oGame,oSelf,nValue,nRow,nCol) nValue = oGame.aObjects[2].getvalue(oSelf.x,oSelf.y+oSelf.height) nRow = oGame.aObjects[2].getrow(oSelf.x,oSelf.y+oSelf.height) nCol = oGame.aObjects[2].getcol(oSelf.x,oSelf.y+oSelf.height) checkstarskey(oGame,oSelf,nValue,nRow,nCol) func callenemystate oGame for t in oGame.aObjects t { if type = GE_TYPE_ENEMY call state(oGame,t) ok } next Class GameState down = 3 gameresult = false Score = 0 startplay=false lastcol = 0 playerwin = false DoorKey = false playerindex = 4 value = 1000 moveplayer = false Screen Shot: 47.29. Super Man 2016 Game 398
  • 2. Ring Documentation, Release 1.3 47.29. Super Man 2016 Game 399
  • 3. CHAPTER FORTYEIGHT BUILDING GAMES FOR ANDROID In this chapter we will learn about Building RingLibSDL Games for Mobile. So we can create packages (*.apk) for the applications that are developed using Ring Game Engine for 2D Games. 48.1 Download Requirements and Update the Android SDK • The Android SDK Tools https://developer.android.com/studio/index.html • The Android NDK https://developer.android.com/ndk/index.html • Apache Ant v1.8 or later http://ant.apache.org/bindownload.cgi • Java SE Development Kit (JDK) v6 or later http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html • Update the Android SDK to get the API and tools packages required for development 48.2 Project Folder Open the project folder : ring/android/ringlibsdl/project 400
  • 4. Ring Documentation, Release 1.3 You can add the source code (*.ring) and Images/Sound Files to the assets folder. You will find the Flappy Bird 3000 Game ready for building. The execution starts from the start.ring file load "game2.ring" 48.3 Building the project Move to the ring/android/ringlibsdl/project folder We can build using the next command (We need to do this for one time only). ndk-build Then we can create the package (*.apk) using the next command. 48.3. Building the project 401
  • 5. Ring Documentation, Release 1.3 ant debug 48.3. Building the project 402
  • 6. CHAPTER FORTYNINE DESKTOP AND MOBILE DEVELOPMENT USING RINGQT In this chapter we will learn how to use the Qt framework classes in our Ring applications to create Desktop and Mobile Applications. 49.1 The First GUI Application In this example we will create an application to ask the user about his/her name. When the user type the name in the textbox then click on “Say Hello” button, the textbox value will be updated by adding “Hello ” to the name. Load "guilib.ring" MyApp = New qApp { win1 = new qWidget() { setwindowtitle("Hello World") setGeometry(100,100,370,250) label1 = new qLabel(win1) { settext("What is your name ?") setGeometry(10,20,350,30) setalignment(Qt_AlignHCenter) } btn1 = new qpushbutton(win1) { setGeometry(10,200,100,30) settext("Say Hello") setclickevent("pHello()") } btn1 = new qpushbutton(win1) { setGeometry(150,200,100,30) settext("Close") setclickevent("pClose()") } lineedit1 = new qlineedit(win1) { setGeometry(10,100,350,30) } show() } 403
  • 7. Ring Documentation, Release 1.3 exec() } Func pHello lineedit1.settext( "Hello " + lineedit1.text()) Func pClose MyApp.quit() Program Output: At first we type the name in the textbox Then we click on the say hello button 49.1. The First GUI Application 404
  • 8. Ring Documentation, Release 1.3 49.2 Using Layout The next example is just an upgrade to the previous application to use the vertical layout. Load "guilib.ring" MyApp = New qApp { win1 = new qWidget() { setwindowtitle("Hello World") setGeometry(100,100,400,130) label1 = new qLabel(win1) { settext("What is your name ?") setGeometry(10,20,350,30) setalignment(Qt_AlignHCenter) } btn1 = new qpushbutton(win1) { setGeometry(10,200,100,30) settext("Say Hello") setclickevent("pHello()") } btn2 = new qpushbutton(win1) { setGeometry(150,200,100,30) settext("Close") setclickevent("pClose()") } lineedit1 = new qlineedit(win1) { setGeometry(10,100,350,30) } layout1 = new qVBoxLayout() { addwidget(label1) addwidget(lineedit1) addwidget(btn1) addwidget(btn2) } win1.setlayout(layout1) show() } exec() } Func pHello lineedit1.settext( "Hello " + lineedit1.text()) Func pClose MyApp.quit() The application during the runtime! 49.2. Using Layout 405
  • 9. Ring Documentation, Release 1.3 49.3 Using the QTextEdit Class In this example we will use the QTextEdit Class Load "guilib.ring" New qApp { win1 = new qWidget() { setwindowtitle("QTextEdit Class") setGeometry(100,100,500,500) new qtextedit(win1) { setGeometry(10,10,480,480) } show() } exec() } During the runtime we can paste rich text in the qtextedit widget 49.3. Using the QTextEdit Class 406
  • 10. Ring Documentation, Release 1.3 49.4 Using the QListWidget Class In this example we will use the QListWidget Class Load "guilib.ring" New qApp { win1 = new qWidget() { setGeometry(100,100,400,400) list1 = new qlistwidget(win1) { setGeometry(150,100,200,200) alist = ["one","two","three","four","five"] for x in alist additem(x) next setcurrentrow(3,2) win1.setwindowtitle("Items Count : " + count() ) } 49.4. Using the QListWidget Class 407