ppforge/internal/app/app.go

40 lines
832 B
Go
Raw Normal View History

package app
2022-11-23 20:33:07 +01:00
import (
2022-11-24 21:49:10 +01:00
"fyne.io/fyne/v2"
2022-11-23 20:33:07 +01:00
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/container"
"gitea.mmo.to/ProtocolPacketForger/ppf/internal/ui"
2022-11-23 20:33:07 +01:00
)
var fyneApp fyne.App
var w fyne.Window
2022-11-23 20:33:07 +01:00
func Appmain() {
fyneApp = app.New()
w = fyneApp.NewWindow("ProtocolPacketForger")
w.Resize(fyne.NewSize(1024, 768))
2022-11-23 20:33:07 +01:00
w.SetContent(CreateApp())
2022-11-23 20:33:07 +01:00
w.ShowAndRun()
}
2022-11-25 11:36:29 +01:00
func CreateApp() *fyne.Container {
2023-01-05 09:06:39 +01:00
ui.PPF.Toolbar = ui.CreateToolbar(fyneApp)
ui.PPF.Workarea = ui.CreateWorkarea()
ui.PPF.Extensions = container.NewCenter()
ui.PPF.ProtocolMeta = ui.CreateMetadataProtocol()
ui.PPF.Metadata = &ui.PPF.ProtocolMeta.Metadata
ui.PPF.ContextBar = container.NewCenter()
2022-11-25 11:36:29 +01:00
return container.NewBorder(
2023-01-05 09:06:39 +01:00
ui.PPF.Toolbar,
ui.PPF.ContextBar,
ui.PPF.Metadata.Representation,
ui.PPF.Extensions,
container.NewVScroll(ui.PPF.Workarea),
2022-11-25 11:36:29 +01:00
)
}