Widgets»Workspace

Workspace

Workspace is a container which re-orders its children upon mouse button presses. The clicked widget becomes the top-most widget. It's useful for managing windows and other user-movable elements within Hybrid.

Source docs

[hfill hexpand vfill vexpand] new ClipView {
    useChildSize = 3;

    [hfill hexpand vfill vexpand] new Workspace {
        size = 160 120;
        style.normal = {
            background = solid(rgb(.1, .1, .1));
        }

        new Draggable {
            layout = { padding = 5 5; }
            style.normal = { background = solid(rgb(.7, 0, 0)); border = 1 white; }
            new Label { text = "drag me 1"; }
            new Button;
        }

        new Draggable {
            layout = { padding = 5 5; }
            style.normal = { background = solid(rgb(0, .7, 0)); border = 1 white; }
            new Label { text = "drag me 2"; }
            new ClipView {
                style.normal = { border = 1 black; }
                size = 80 60;
                new Workspace {
                    size = 80 60;
                    new Draggable {
                        style.normal = { background = solid(rgb(0, .7, .7)); border = 1 white; }
                        new Label { text = "drag me 4"; }
                    }
                }
            }
        }

        new Draggable {
            alwaysDrag = true;
            layout = { padding = 5 5; }
            style.normal = { background = solid(rgb(0, 0, .7)); border = 1 white; }
            new Label { text = "drag me 3"; }
            new Check { text = "oh hai"; }
            new Button;
        }
    }
}