Adham Zahran's Avatar
Adham Zahran
Member since

Recent Activity

so I am trying to create Qt's qml, but from scratch. for learning purposes but also I think it would be cool if it was an option to use qml without Qt

This is the qml, that produces this output:

Item {
    Rectangle {
        x: red.x - 5
        y: red.y - 5
        width: 150
        height: 100
        color: "#333"
    }

    Rectangle {
        id: red
        x: 55
        y: 55
        width: 150
        height: 100
        color: "#a22"

        MouseArea {
            id: red_mouse_area
            x: red.x
            y: red.y
            width: red.width
            height: red.height
        }
    }

    Text {
        text: "Hello World!"
        x: red.x
        y: red.y - height - 5
        height: 15
    }
}

the c code only sets the red rectangle's location, the others follow automatically because the qml tells them to do so 😄

void
an_event_happened(void* user_data, struct event_t e)
{
    struct app_state_t* app_state = (struct app_state_t*)user_data;

    size_t red = engine_get_object_by_id(lol_engine(app_state->lol), "red");

    int64_t red_w = engine_object_width(lol_engine(app_state->lol), red);
    int64_t red_h = engine_object_height(lol_engine(app_state->lol), red);

    engine_object_set_x(lol_engine(app_state->lol), red, e.mouse_x - red_w/2);
    engine_object_set_y(lol_engine(app_state->lol), red, e.mouse_y - red_h/2);
}
View original message on Discord

Also, why are we limiting ourselves to having stdout go to exactly one other place? what if I wanna pipe it to 2 or 3 processes? what if I also wanna write its output to some file on the disk?

While we're at it, does the process even need to be on the same computer? what if we can connect processes on different computers and different networks?

https://gitlab.com/lordadamson/golash

View original message on Discord

&gollash Processes communicate with stdin, stout and stderr. What if we could make a node editor UI where you can create a script, but instead of using the weird bash syntax you can have a nice UI where you connect nodes the way you want.

so far I've only built a small part of the UI 😄

View original message on Discord