Documentation
¶
Overview ¶
Package click provides methods to compose click handlers.
Index ¶
- func Back(do func()) func(bar.Event)
- func BackE(handler func(bar.Event)) func(bar.Event)
- func Button(do func(bar.Button), btns ...bar.Button) func(bar.Event)
- func ButtonE(handler func(bar.Event), btns ...bar.Button) func(bar.Event)
- func Click(do func(), includeBackAndForward ...bool) func(bar.Event)
- func DiscardEvent(fn func()) func(bar.Event)
- func Forward(do func()) func(bar.Event)
- func ForwardE(handler func(bar.Event)) func(bar.Event)
- func Left(do func()) func(bar.Event)
- func LeftE(handler func(bar.Event)) func(bar.Event)
- func Middle(do func()) func(bar.Event)
- func MiddleE(handler func(bar.Event)) func(bar.Event)
- func Right(do func()) func(bar.Event)
- func RightE(handler func(bar.Event)) func(bar.Event)
- func RunLeft(cmd string, args ...string) func(bar.Event)
- func Scroll(do func(bar.Button)) func(bar.Event)
- func ScrollDown(do func()) func(bar.Event)
- func ScrollDownE(handler func(bar.Event)) func(bar.Event)
- func ScrollLeft(do func()) func(bar.Event)
- func ScrollLeftE(handler func(bar.Event)) func(bar.Event)
- func ScrollRight(do func()) func(bar.Event)
- func ScrollRightE(handler func(bar.Event)) func(bar.Event)
- func ScrollUp(do func()) func(bar.Event)
- func ScrollUpE(handler func(bar.Event)) func(bar.Event)
- type Map
- func (m Map) Back(do func()) Map
- func (m Map) BackE(handler func(bar.Event)) Map
- func (m Map) Else(handler func(bar.Event)) Map
- func (m Map) Forward(do func()) Map
- func (m Map) ForwardE(handler func(bar.Event)) Map
- func (m Map) Handle(e bar.Event)
- func (m Map) Left(do func()) Map
- func (m Map) LeftE(handler func(bar.Event)) Map
- func (m Map) Middle(do func()) Map
- func (m Map) MiddleE(handler func(bar.Event)) Map
- func (m Map) Right(do func()) Map
- func (m Map) RightE(handler func(bar.Event)) Map
- func (m Map) ScrollDown(do func()) Map
- func (m Map) ScrollDownE(handler func(bar.Event)) Map
- func (m Map) ScrollLeft(do func()) Map
- func (m Map) ScrollLeftE(handler func(bar.Event)) Map
- func (m Map) ScrollRight(do func()) Map
- func (m Map) ScrollRightE(handler func(bar.Event)) Map
- func (m Map) ScrollUp(do func()) Map
- func (m Map) ScrollUpE(handler func(bar.Event)) Map
- func (m Map) Set(btn bar.Button, handler func(bar.Event)) Map
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Back ¶
Back creates a click handler that invokes the given function when a ButtonBack event is received.
func Button ¶
Button invokes the given function when any of the specified buttons trigger the event handler. It passes only the button to the function. To get the complete event, see ButtonE.
func ButtonE ¶
ButtonE filters out events triggered by buttons not listed in btns before invoking the given click handler.
func Click ¶
Click invokes the given function on button clicks only (ignoring scroll). includeBackAndForward controls whether the back and forward buttons also trigger the handler. (Only the first value is used, but varargs provide an "optional" argument here.). Defaults to false.
func DiscardEvent ¶
DiscardEvent wraps a function with no arguments in a function that takes a bar.Event, allowing a func() to be used as a click handler.
func Forward ¶
Forward creates a click handler that invokes the given function when a ButtonForward event is received.
func ForwardE ¶
ForwardE wraps the click handler so that it is only triggered by a ButtonForward event.
func Left ¶
Left creates a click handler that invokes the given function when a ButtonLeft event is received.
func Middle ¶
Middle creates a click handler that invokes the given function when a ButtonMiddle event is received.
func MiddleE ¶
MiddleE wraps the click handler so that it is only triggered by a ButtonMiddle event.
func Right ¶
Right creates a click handler that invokes the given function when a ButtonRight event is received.
func RunLeft ¶
RunLeft executes the given command on a left-click. This is a shortcut for click.Left(func(){exec.Command(cmd).Run()}).
func Scroll ¶
Scroll invokes the given function on all scroll events, and passes in the button (e.g. bar.ScrollUp).
func ScrollDown ¶
ScrollDown creates a click handler that invokes the given function when a ScrollDown event is received.
func ScrollDownE ¶
ScrollDownE wraps the click handler so that it is only triggered by a ScrollDown event.
func ScrollLeft ¶
ScrollLeft creates a click handler that invokes the given function when a ScrollLeft event is received.
func ScrollLeftE ¶
ScrollLeftE wraps the click handler so that it is only triggered by a ScrollLeft event.
func ScrollRight ¶
ScrollRight creates a click handler that invokes the given function when a ScrollRight event is received.
func ScrollRightE ¶
ScrollRightE wraps the click handler so that it is only triggered by a ScrollRight event.
Types ¶
type Map ¶
Map stores a mapping of button to event handler.
func (Map) ScrollDown ¶
ScrollDown invokes the given function on ScrollDown events.
func (Map) ScrollDownE ¶
ScrollDownE sets the click handler for ScrollDown events.
func (Map) ScrollLeft ¶
ScrollLeft invokes the given function on ScrollLeft events.
func (Map) ScrollLeftE ¶
ScrollLeftE sets the click handler for ScrollLeft events.
func (Map) ScrollRight ¶
ScrollRight invokes the given function on ScrollRight events.
func (Map) ScrollRightE ¶
ScrollRightE sets the click handler for ScrollRight events.