package ui import ( "fyne.io/fyne/v2" "fyne.io/fyne/v2/container" "fyne.io/fyne/v2/widget" "gitea.mmo.to/ppForge/ppforge/packet" ) type PacketFieldEditor struct { Representation *fyne.Container Value *widget.Entry Reference *packet.FieldValue GlobalIndex int LayerIndex int Index int } func CreatePacketFieldEditor( ed *PacketEditor, gblidx int, lyridx int, index int, ref *packet.FieldValue, ) *PacketFieldEditor { pfe := &PacketFieldEditor{} pfe.Reference = ref pfe.Index = index pfe.LayerIndex = lyridx pfe.GlobalIndex = gblidx setfunc := func(s string) { //todo //ed.Reference.UpdateField(&ed.Reference.Layers[lyridx], index, packet.NewFieldValue(s)) } elements := []fyne.CanvasObject{} elements = append(elements, widget.NewLabel("TODO")) if ed.ShowShortHints { elements = append(elements, widget.NewLabel("TODO")) // todo: implement real shorthints if feasible } // depending on the input stuff, entry for now pfe.Value = widget.NewEntry() pfe.Value.OnChanged = setfunc elements = append(elements, pfe.Value) pfe.Representation = container.NewHBox(elements...) return pfe }