Questions regarding PWCT2

48 views
Skip to first unread message

stefan schaenzer

unread,
Feb 16, 2024, 12:12:48 PMFeb 16
to The Ring Programming Language
I am currently trying out PWCT2 and have a few questions:

1. the PWCT2 help says, "PWCT 2.0 comes with Ring2PWCT, which can import any textual source code file." Unfortunately, I cannot find Ring2PWCT. How can I import Ring source code into PWCT2?

2. in PWCT2, the Project Files window only shows the demo examples directory. If I save my project file with my code in a different directory, how can I change the project directory?  In Ring Notepad, the behavior is as I expect it to be. I do not understand the meaning of Project Files in PWCT2.

3. can I use the full scope of Ring with PWCT2, or are there limitations? I have not yet managed to recreate a working Ring code that executes a simple qRing app in PWCT2. Hence, my first question ;-)

Here is the code I wanted to rebuild in PWCT2:

load "guilib.ring"


oApp = new qApp {

   oWinMain = new qWidget() {

       setWindowTitle("My Main Window")

setGeometry(100,100,370,250)

       oLbl_1 = new qlabel(oWinMain) {

           setText("Hello World!")    

       } # lbl_1

       oLbl_2 = new qlabel(oWinMain) {

           setText("Another label!")

       } # lbl_2

       oVbox = new qVboxlayout() {

           addwidget(oLbl_1)

           addwidget(oLbl_2)    

       } # vbox

       setlayout(oVbox)

       show()    

   } # window

   exec()

} # App


Greetings
Stefan

Mahmoud Fayed

unread,
Feb 16, 2024, 5:54:46 PMFeb 16
to The Ring Programming Language
Hello Stefan


The idea of Ring2PWCT is simple.
click on the goal designer (on any step inside the steps tree)
Then start typing Ring code like: new point {x=10 y=20 z=30} class point x y z
Then press ENTER.

Another way is to copy some code.
click on the search textbox inside the Components Browser window.
press CTRL+V then ENTER.

The next screen shot demonstrates converting the code that you provided.

At first, we copy the code and paste it in the search textbox in the Components browsershot1.png

Then we press ENTER, and Ring2PWCT will be executed to get the steps tree
shot2.png

Then we can run the application
shot3.png

To have a good idea about PWCT2 features, see these videos: ring/marketing/pwct at master · ring-lang/ring (github.com)

Greetings,
Mahmoud

Mahmoud Fayed

unread,
Feb 16, 2024, 6:19:49 PMFeb 16
to The Ring Programming Language
Hello Stefan

>> "in PWCT2, the Project Files window only shows the demo examples directory. If I save my project file with my code in a different directory, how can I change the project directory?"

We need to add this feature to be able to browse the folder files if it exists in another location.
But you can open the any PWCT file from any location using File-Open or the Open button from the toolbar.

>> "can I use the full scope of Ring with PWCT2, or are there limitations?"

Yes you have the full scope of Ring
No limitations.

The idea behind PWCT is to be general-purpose.

Greetings,
Mahmoud


On Friday, February 16, 2024 at 8:12:48 PM UTC+3 stefan.s...@mailbox.org wrote:

stefan schaenzer

unread,
Feb 17, 2024, 6:36:31 AMFeb 17
to The Ring Programming Language
Hello Mahmoud,

many thanks for the tips. Despite the integrated help, I wouldn't have figured it out on my own.

Greetings
Stefan

Mahmoud Fayed

unread,
Feb 17, 2024, 5:42:57 PMFeb 17
to The Ring Programming Language
Hello Stefan

>> "many thanks for the tips. Despite the integrated help, I wouldn't have figured it out on my own."

You are welcome :D

This happens because writing text input (source code) when the keyboard focus exists in TreeWidget or Search TextBox is not common.
And screen shots in the documentation could appears like the written Ring code is just comments about the Steps Tree.

Greetings,
Mahmoud

Reply all
Reply to author
Forward
0 new messages