// Update implements gruid.Model.Update for Pager. It considers mouse message
// coordinates to be absolute in its grid. If a gruid.MsgInit is passed to
// Update, the pager will behave as if it is the main model of an application,
// and send a gruid.Quit() command on PagerQuit action.
Update implements gruid.Model.Update for Pager. It considers mouse message
coordinates to be absolute in its grid. If a gruid.MsgInit is passed to
Update, the pager will behave as if it is the main model of an application,
and send a gruid.Quit() command on PagerQuit action.
// Update implements gruid . Model . Update for Pager . It considers mouse message // coordinates to be absolute in its grid . If a gruid . MsgInit is passed to // Update the pager will behave as if it is the main model of an application // and send a gruid . Quit () command on PagerQuit action .
func (pg *Pager) Update(msg gruid.Msg) gruid.Effect {
	pg.action = PagerPass
	var eff gruid.Effect
	switch msg := msg.(type) {
	case gruid.MsgInit:
		pg.init = true
	case gruid.MsgKeyDown:
		eff = pg.updateMsgKeyDown(msg)
	case gruid.MsgMouse:
		eff = pg.updateMsgMouse(msg)
	}
	if pg.Action() != PagerPass {
		pg.dirty = true
	}
	return eff
}
func ( pg * Pager ) Update ( msg gruid . Msg ) gruid . Effect { pg . action = PagerPass var eff gruid . Effect switch msg := msg . ( type ) { case gruid . MsgInit : pg . init = true case gruid . MsgKeyDown : eff = pg . updateMsgKeyDown ( msg ) case gruid . MsgMouse : eff = pg . updateMsgMouse ( msg ) } if pg . Action ( ) != PagerPass { pg . dirty = true } return eff }
Update implements gruid.Model.Update for Pager.
Update implements gruid . Model . Update for Pager .