diff --git a/cutils/cutils.go b/cutils/cutils.go new file mode 100644 index 0000000..84a650e --- /dev/null +++ b/cutils/cutils.go @@ -0,0 +1,22 @@ +package cutils + +import "github.com/orus-dev/osui" + +func WithPosition(x, y int, c osui.Component) osui.Component { + data := c.GetComponentData() + data.X = x + data.Y = y + return c +} + +func WithStyle(style interface{}, c osui.Component) osui.Component { + c.SetStyle(style) + return c +} + +func WithSize(width, height int, c osui.Component) osui.Component { + data := c.GetComponentData() + data.Width = width + data.Height = height + return c +}