action

package
v0.0.0-...-0caaa62 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2017 License: GPL-3.0-or-later Imports: 1 Imported by: 0

Documentation

Overview

Package action provides actions management for applets.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Actions

type Actions struct {
	Max     int // Maximum number of concurrent actions (simultaneous).
	Current int // Current number of active actions.
	// contains filtered or unexported fields
}

Actions manages applet internal actions list.

func (*Actions) Add

func (o *Actions) Add(acts ...*cdtype.Action)

Add adds actions to the list.

func (*Actions) BuildMenu

func (o *Actions) BuildMenu(menu cdtype.Menuer, actionIds []int)

BuildMenu fills the menu with the given actions list.

func (*Actions) Callback

func (o *Actions) Callback(ID int) func()

Callback returns a callback to the given action ID.

func (*Actions) CallbackInt

func (o *Actions) CallbackInt(ID int) func(int)

CallbackInt returns a callback to the given action ID.

func (*Actions) CallbackMenu

func (o *Actions) CallbackMenu(actionIds ...int) func(menu cdtype.Menuer)

CallbackMenu provides a fill menu callback with the given actions list.

func (*Actions) Count

func (o *Actions) Count() int

Count returns the number of started actions.

func (*Actions) ID

func (o *Actions) ID(name string) int

ID finds the ID matching given action name.

func (*Actions) Launch

func (o *Actions) Launch(ID int)

Launch starts the desired action by ID.

func (*Actions) Len

func (o *Actions) Len() int

Len returns the number of actions defined.

func (*Actions) SetBool

func (o *Actions) SetBool(ID int, boolPointer *bool)

SetBool sets the pointer to the boolean value for a checkentry menu field.

func (*Actions) SetIndicators

func (o *Actions) SetIndicators(onStart, onStop func())

SetIndicators set the pre and post action callbacks.

func (*Actions) SetMax

func (o *Actions) SetMax(max int)

SetMax sets the maximum number of actions that can be started at the same time.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL