Rant about drawing a circle.

"Lost in Translation" belongs to a select group of great movies I don't think I'll ever watch, because I just don't feel like it. The three Godfathers are in that list as well, and so is Titanic. I'm sure I'm leaving out some others.
Force yourself. Give it a try.
It's really not like dirty dancing , ghost , or the sound of music.
 
Someone has written some sample programs in zig/gtk+ here: https://github.com/Swoogan/ziggtk It maps to the Gtk+ tutorial here https://docs.gtk.org/gtk3/ , so it's a good introduction. I would suggest using that as a base to experiment with graphics algorithms in zig, it looks pretty good. Either that, or follow the xcb tutorial and use xcb https://www.x.org/releases/X11R7.7/doc/libxcb/tutorial/index.html .
Very bad documentation ...
But after working dlang+gtk now,
I have something working with golang+fine,


Code:
package main

import (
    "fyne.io/fyne/v2"
    "fyne.io/fyne/v2/app"
    "fyne.io/fyne/v2/canvas"
    "fyne.io/fyne/v2/container"
    "image/color"
)

func main() {
    // Maak een nieuwe applicatie en een venster aan
    myApp := app.New()
    myWindow := myApp.NewWindow("Cirkel Voorbeeld")

    // Maak een cirkel-object (gevuld met een blauwe kleur)
    circle := canvas.NewCircle(color.NRGBA{R: 0, G: 150, B: 255, A: 255})
   
    // Voeg een rand toe
    circle.StrokeColor = color.Black
    circle.StrokeWidth = 2
   
    // Stel de grootte en positie in
    circle.Resize(fyne.NewSize(200, 200))
    circle.Move(fyne.NewPos(50, 50))

    // Plaats de cirkel in een container zonder automatische layout
    myWindow.SetContent(container.NewWithoutLayout(circle))
    myWindow.Resize(fyne.NewSize(300, 300))

    // Start de applicatie
    myWindow.ShowAndRun()
}
 
Back
Top