fc
fc copied to clipboard
Combining fc with fyne (proper)
AJ
Any way to make an app with a border layout with an fc Canvas as the central element?
The EndRun method may conflict with fyne.Window's ShowAndRun.
Congrats on a useful package!
glenn
I think they will integrate as fc is built on fyne fundamental objects.
Hi @hippodribble
The EndRun method may conflict with fyne.Window's ShowAndRun.
Then try this:
func main() {
width := 500
height := 500
blue := color.RGBA{0, 0, 255, 255}
white := color.RGBA{255, 255, 255, 255}
canvas := fc.NewCanvas("hello", width, height)
canvas.Circle(50, 0, 100, blue)
canvas.Rect(20, 25, 20, 40, colornames.Green)
canvas.CText(50, 25, 10, "hello, world", white)
canvas.Image(50, 75, 200, 200, "earth.jpg")
window := createWindow(canvas)
window.ShowAndRun()
}
func createWindow(c fc.Canvas) fyne.Window {
w := c.Window
w.Resize(fyne.NewSize(float32(c.Width), float32(c.Height)))
w.SetFixedSize(true)
w.SetPadded(false)
w.SetContent(c.Container)
return w
}
I would like to ask you like https://github.com/fyne-io/fyne/issues/2924, do you plan or would you allow me make some modifications to make "only" CanvasObject to integrate to fyne?