Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Smalltalk, but not quite

Name: Anonymous 2012-02-20 12:28

A dozen years ago, smalltalk was considered the number one graphical interface language, pretty much defining what is nowadays known as turtle graphics.

Unfortunately, smalltalk has a very old object system, one that is considered ancient today; So I decided to whip out a design for a less verbose object system, one that may be easier to learn.

What do you think?


import System.
import Extra/Qt [QtGui].

class Example uses (QtGui/QWidget) [
    new := [
        super: new.
        self initUI.
    ]

    initUI := [
        self setGeometry: [300, 300, 250, 150].
        self setWindowTitle: "Icon".
        self setWindowIcon: (QtGui/QIcon new: "web.png").
        self show.
    ]
].


define [app, ex]
app := QtGui/QApplication new: System/ARGV.
ex := Example new.
System/Exit: (app: exec).

Name: Anonymous 2012-02-21 4:35

I don't know if stuff like QtGui/QIcon would work out if you were going to support the symbolic arithmetic operators. What if QtGui and QIcon where both floating point numbers in this case? But maybe it could work. I suppose the / would be a method implemented in QtGui (whatever it might be), and in this case, it would take one unevaluated name argument QIcon and retrieve the QIcon inner type of QtGui?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List