why Calling Function without definition ??

31 views
Skip to first unread message

stefano cerbioni

unread,
Mar 21, 2023, 12:20:51 PM3/21/23
to The Ring Programming Language
why this  script  return Calling Function without definition !: setcentralwidget 

Load "guilib.ring"
New qApp {

        win1 = new qWidget() {

                setwindowtitle("Gui")
                setGeometry(100,100,800,900)

                New QComboBox(win1) {
                        setGeometry(500,10,200,21)
                        alist = ["one","two","three","four","five"]
                        for x in aList additem(x,0) next
                }
               
                btn1 = new qpushbutton(win1) {
                        setGeometry(710,10,80,21)
                        settext("RI-CARICA")
                        setclickevent("_Reload()")
                }

                Table1 = new qTableWidget(win1) {

                        setrowcount(10) setcolumncount(10)
                        setGeometry(0,0,800,400)
                        setselectionbehavior(QAbstractItemView_SelectRows)
                        for x = 1 to 10
                                for y = 1 to 10
                                        item1 = new qtablewidgetitem("R"+X+"C"+Y)
                                        setitem(x-1,y-1,item1)
                                next
                        next
                }
                setcentralwidget(table1)      
                show()
        }
        exec()
}
_Reload(){
}

and  this work correct ?
Load "guilib.ring" New qApp { win1 = new qMainWindow() { setGeometry(100,100,1100,370) setwindowtitle("Using QTableWidget") Table1 = new qTableWidget(win1) { setrowcount(10) setcolumncount(10) setGeometry(0,0,800,400) setselectionbehavior(QAbstractItemView_SelectRows) for x = 1 to 10 for y = 1 to 10 item1 = new qtablewidgetitem("R"+X+"C"+Y) setitem(x-1,y-1,item1) next next } setcentralwidget(table1) show() } exec() }

stefano cerbioni

unread,
Mar 21, 2023, 1:09:53 PM3/21/23
to The Ring Programming Language
i find a solution  qWidget io must change in qMainWindow ,  but  why exist this ? qwidget ? which sense have 2 type of istruction that do  the same things but one do  not compleatly ?? the legic behind ?
Message has been deleted

Mahmoud Fayed

unread,
Mar 21, 2023, 10:25:32 PM3/21/23
to The Ring Programming Language
Hello Stefano


Also, Remember that QWidget can be created and added to other widgets like QTableWidget & QTreeWidget
So It's the default choice when you would like to do customization

We can use QMainWindow and add it also to other widget but this is not recommended (Not the standard)
But we do this as we add the (Form Designer) main window to a dock-able widget that exist inside (Ring Notepad)
And we have two menubars (One for Ring Notepad) and (One for the Form Designer)

Greetings,
Mahmoud

Ilir Liburn

unread,
Mar 23, 2023, 9:39:13 PM3/23/23
to stefano cerbioni, The Ring Programming Language
Hello Stefano,

qMainWindow() is application window, qWidget is element inside the
application window. First creates window which is under control of the
OS, second creates element which is under control of the application.

Greetings,
Ilir
>> 800,400) setselectionbehavior(QAbstractItemView_SelectRows) for x = 1 to
>> 10 for y = 1 to 10 item1 = new qtablewidgetitem("R"+X+"C"+Y)
>> setitem(x-1,y
>> -1,item1) next next } setcentralwidget(table1) show() } exec() }
>>
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "The Ring Programming Language" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ring-lang+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ring-lang/68c75f61-75a5-4c9a-a676-5bb9abf468bbn%40googlegroups.com.
>
Reply all
Reply to author
Forward
0 new messages