// NewPager returns a new pager with given configuration options.
NewPager returns a new pager with given configuration options.
// NewPager returns a new pager with given configuration options .
func NewPager(cfg PagerConfig) *Pager {
	pg := &Pager{
		grid:  cfg.Grid,
		box:   cfg.Box,
		lines: cfg.Lines,
		style: cfg.Style,
		keys:  cfg.Keys,
	}
	if pg.keys.Down == nil {
		pg.keys.Down = []gruid.Key{gruid.KeyArrowDown, "j"}
	}
	if pg.keys.Up == nil {
		pg.keys.Up = []gruid.Key{gruid.KeyArrowUp, "k"}
	}
	if pg.keys.PageDown == nil {
		pg.keys.PageDown = []gruid.Key{gruid.KeyPageDown, "f"}
	}
	if pg.keys.PageUp == nil {
		pg.keys.PageUp = []gruid.Key{gruid.KeyPageUp, "b"}
	}
	if pg.keys.Left == nil {
		pg.keys.Left = []gruid.Key{gruid.KeyArrowLeft, "h"}
	}
	if pg.keys.Right == nil {
		pg.keys.Right = []gruid.Key{gruid.KeyArrowRight, "l"}
	}
	if pg.keys.Start == nil {
		pg.keys.Start = []gruid.Key{"^", "0"}
	}
	if pg.keys.HalfPageDown == nil {
		pg.keys.HalfPageDown = []gruid.Key{gruid.KeyEnter, "d"}
	}
	if pg.keys.HalfPageUp == nil {
		pg.keys.HalfPageUp = []gruid.Key{gruid.KeyBackspace, "u"}
	}
	if pg.keys.Top == nil {
		pg.keys.Top = []gruid.Key{gruid.KeyHome, "g"}
	}
	if pg.keys.Bottom == nil {
		pg.keys.Bottom = []gruid.Key{gruid.KeyEnd, "G"}
	}
	if pg.keys.Quit == nil {
		pg.keys.Quit = []gruid.Key{gruid.KeyEscape, "q", "Q"}
	}
	pg.dirty = true
	return pg
}
func NewPager ( cfg PagerConfig ) * Pager { pg := & Pager { grid : cfg . Grid , box : cfg . Box , lines : cfg . Lines , style : cfg . Style , keys : cfg . Keys , } if pg . keys . Down == nil { pg . keys . Down = [ ] gruid . Key { gruid . KeyArrowDown , " " } } if pg . keys . Up == nil { pg . keys . Up = [ ] gruid . Key { gruid . KeyArrowUp , " " } } if pg . keys . PageDown == nil { pg . keys . PageDown = [ ] gruid . Key { gruid . KeyPageDown , " " } } if pg . keys . PageUp == nil { pg . keys . PageUp = [ ] gruid . Key { gruid . KeyPageUp , " " } } if pg . keys . Left == nil { pg . keys . Left = [ ] gruid . Key { gruid . KeyArrowLeft , " " } } if pg . keys . Right == nil { pg . keys . Right = [ ] gruid . Key { gruid . KeyArrowRight , " " } } if pg . keys . Start == nil { pg . keys . Start = [ ] gruid . Key { " " , " " } } if pg . keys . HalfPageDown == nil { pg . keys . HalfPageDown = [ ] gruid . Key { gruid . KeyEnter , " " } } if pg . keys . HalfPageUp == nil { pg . keys . HalfPageUp = [ ] gruid . Key { gruid . KeyBackspace , " " } } if pg . keys . Top == nil { pg . keys . Top = [ ] gruid . Key { gruid . KeyHome , " " } } if pg . keys . Bottom == nil { pg . keys . Bottom = [ ] gruid . Key { gruid . KeyEnd , " " } } if pg . keys . Quit == nil { pg . keys . Quit = [ ] gruid . Key { gruid . KeyEscape , " " , " " } } pg . dirty = true return pg }
NewPager returns a new pager with given configuration options.
NewPager returns a new pager with given configuration options .