On Sunday, 8 December 2024 at 04:06:40 UTC, Alain De Vos wrote:
I look for a demo program how to draw a simple square with gtk-d ?

Are you looking for drawing green square using D or gtk? (I observed your comment in reddit/r/crystal_programming as well). You can use Chitra library to draw a square and save it as png. Try it out.

```d
import chitra;

void main()
{
    // Canvas of size 400x400
    auto ctx = new Chitra(400);
    ctx.fill(0, 255, 0);
    ctx.square(0, 0, 400);
    ctx.saveAs("green_rect.png");
}
```

Refer https://github.com/aravindavk/chitra-d for installation and usage details.

Reply via email to