Array of buttons using the Ring programming language

Hello

In this example we learn about creating an array of buttons in our GUI applications using the Ring programming language

load “guilib.ring”

App1 = new qApp {

win1 = new qWidget() {

move(0,0)

resize(500,500)

new qPushButton(win1)

{

settext(“OK”)

setclickevent(“click()”)

}

btn1 = new qPushButton(win1)

{

setgeometry(100,100,100,30)

settext(“Button1”)

}

btn2 = new qPushButton(win1)

{

setgeometry(200,100,100,30)

settext(“Button2”)

}

button = [btn1, btn2]

show()

}

exec()

}

func click

button[1] { settext (“Button3”) }

button[2] { settext (“Button4”) }

The application

arrayofbtns

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s