Creating a Modal Window using the Ring programming language

Hello

This example demonstrates how to create a modal window

load "guilib.ring"
app=new qApp

{

frmStart=new Qwidget()

{

setWindowTitle(“The First Window”)

resize(300,320)

move(200,200)

 

button=new qPushButton(frmStart)

{

setText(“Show Modal Window”)

resize(200,30)

setClickEvent(“frmModal.show()”)

}

 

new qPushButton(frmStart)

{

setText(“Close Window”)

move(0,50)

resize(200,30)

setClickEvent(“frmStart.Close()”)

}

show()

}

frmModal =new Qwidget()

{

setWindowTitle(“Modal Window”)

resize(300,320)

move(200,200)

setparent(frmStart)

setwindowmodality(true)

setwindowflags(Qt_Dialog)

}

exec()

}

 

Related Documents
http://doc.qt.io/qt-5/qtwidgets-widgets-windowflags-example.html
http://doc.qt.io/qt-5/qt.html#WindowType-enum
http://doc.qt.io/qt-5/qwindow.html#setParent
http://doc.qt.io/qt-5/qt.html#WindowModality-enum

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