how to auto scaling and resizing all items

33 views
Skip to first unread message

kofa kofa

unread,
Jan 31, 2026, 9:46:06 AM (2 days ago) Jan 31
to The Ring Programming Language
As a beginner in ring, I've tried many times but failed. Is there an expert who can give me an example where I can add any element, and when the window resizes, the elements automatically adjust to the new size? The problem with the available examples is that the elements expand to the full screen size, which is undesirable. What I mean, for example, is using `move(10, 15)` and `resize(40, 40)`, so that when the window resizes, the element adjusts to the new size.

Bert Mariani

unread,
Jan 31, 2026, 1:55:36 PM (2 days ago) Jan 31
to The Ring Programming Language
Hello Kofa

Attached:
       Window-ReSize-Icon-7.ring
       Queen.png
       Knight.png

Code of interest

===============
      ###------------------------------------------
      ### ReSizeEvent ... Call WhereAreWe function
      myfilter = new qallevents(win)        
      myfilter.setResizeEvent("WhereAreWe()")
      myfilter.setMoveEvent("WhereMoved()")    
      installeventfilter(myfilter)

================
Func setButtonImage (oBtn, oPixmap, width, height)
     oBtn{ setIcon(new qicon( oPixmap.scaled(width(), height(), 1, 1) ))
                setIconSize(new QSize(width,height))
         }
return
=============
move(moveX, moveY)
 resize(sizeX, sizeY)
=====================
Func WhereMoved()
Func WhereAreWe()
====================

Scaled to new smaller size ( or bigger)

.ReSize-Snap1.png



Window-ReSize-Icon-7.ring
Queen.png
Knight.png

kofa kofa

unread,
Feb 1, 2026, 11:12:27 AM (14 hours ago) Feb 1
to The Ring Programming Language
THANK YOU

kofa kofa

unread,
Feb 1, 2026, 10:39:09 PM (2 hours ago) Feb 1
to The Ring Programming Language
Excuse me, the code you sent me is 221 lines long. As a beginner, I find this difficult. Please allow me to offer a suggestion or perspective: If the goal is to create an easy and professional programming language, it's not professional to write all these lines just to implement automatic scaling. I also encountered a problem with code formatting; the functions should be at the end of the code. Additionally, when I want to implement alignment for ComboBox elements, I find it difficult. I agree that the language is easy to write compared to other languages, but personally, I find that it needs further simplification of functions and commands. I'm not an expert to judge such a great language, but I hope for simplification in achieving the goal, not in the writing style. This is just my opinion. Best regards.

Bert Mariani

unread,
Feb 1, 2026, 11:27:43 PM (2 hours ago) Feb 1
to The Ring Programming Language
Hello Kofa

"... it's not professional to write all these lines just to implement automatic scaling. ..."
"...  the functions should be at the end of the code. .."

True. The program is 221 lines long
It was written in  2020-Jun-16 as a complete program when I was trying to figure out a few things.

It is presented as an Example GUI program
     It shows Moving a Window around the Screen
     It shows Resizing the Window
     It shows Scaling the Output and Images automatically when dimensions are constantly changed
     It shows how to Use QT to create/display the Display

The Functions are right where they should be - at the End of the Code
Functions can be put in Any Order -- because they are Called.

(P.S.  the only thing worst than All Bold is All Capitals)

Regards
Bert Mariani

Reply all
Reply to author
Forward
0 new messages