Index | Files

package switching

import ""

Package switching provides a group that displays modules one at a time, and a controller to switch to the next/previous/specific module.


Package Files


func DefaultButtons Uses

func DefaultButtons(c Controller) (start, end bar.Output)

DefaultButtons provides the default switching buttons: - '<' at the start, if there are modules before the current one, - '>' at the end, if there are modules after the current one.

type ButtonFunc Uses

type ButtonFunc func(Controller) (start, end bar.Output)

ButtonFunc produces outputs for buttons in a switching group.

type Controller Uses

type Controller interface {
    // Current returns the index of the currently active module.
    Current() int
    // Previous switches to the previous module.
    // Next switches to the next module.
    // Show sets the currently active module.
    // Count returns the number of modules in this group
    Count() int
    // ButtonFunc controls the output for the buttons on either end.

Controller provides an interface to control a switching group.

func Group Uses

func Group(m (bar.Module, Controller)

Group returns a new switching group, and a linked controller.

Package switching imports 8 packages (graph). Updated 2018-11-03. Refresh now. Tools for package owners.