package formview

import (
	"go_dreamfactory/cmd/v2/lib/common"
	"go_dreamfactory/cmd/v2/service"
	"go_dreamfactory/cmd/v2/service/observer"

	"fyne.io/fyne/v2"
	"fyne.io/fyne/v2/widget"
)

type BaseformView struct {
	form    *widget.Form
	obs     observer.Observer
	w       fyne.Window
	res     *widget.Entry
	service service.PttService
}

func (view *BaseformView) Init(service service.PttService, obs observer.Observer, w fyne.Window, res *widget.Entry) {
	view.service = service
	view.obs = obs
	view.w = w
	view.res = res
	view.form = widget.NewForm()
	view.form.SubmitText = common.BUTTON_OK
}

func (view *BaseformView) Load() {
	view.form.OnSubmit()
}
