Documentation
¶
Index ¶
- Constants
- type Component
- type ComponentList
- type ComponentMetrics
- type IndicatorWindow
- func (iw *IndicatorWindow) Draw()
- func (iw *IndicatorWindow) IsRunning() bool
- func (iw *IndicatorWindow) ListenEvents()
- func (iw *IndicatorWindow) MoveTo(x, y int)
- func (iw *IndicatorWindow) Run() error
- func (iw *IndicatorWindow) Terminate()
- func (iw *IndicatorWindow) UseFont(fpath string, size uint) (*glfont.Font, error)
- type Point
Constants ¶
View Source
const ( PositionCenterTop uint = iota PositionRightTop PositionRightCenter PositionRightBottom PositionCenterBottom PositionLeftBottom PositionLeftCenter PositionLeftTop )
Prefefined positions for quick setup
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Component ¶
type Component struct { ID string Format string Value any IsVisible bool Font glfont.Font *ComponentMetrics OnClick func(c *Component) Data any // use to save data for `OnClick` or other uses // contains filtered or unexported fields }
Component ..
func NewComponent ¶
func NewComponent(iw *IndicatorWindow, id, format string, fnCheck func(c *Component) any, fnCheckDuration time.Duration) *Component
NewComponent ..
func (*Component) IsClickable ¶
IsClickable have coordinates updated after draw
type ComponentList ¶
type ComponentList []*Component
ComponentList ..
func (ComponentList) CheckAll ¶
func (complist ComponentList) CheckAll()
CheckAll - trigger check for every component
func (ComponentList) FilterVisible ¶
func (complist ComponentList) FilterVisible() ComponentList
FilterVisible - filter only visibles
func (ComponentList) FindByID ¶
func (complist ComponentList) FindByID(id string) *Component
FindByID ..
func (ComponentList) IsAllHidden ¶
func (complist ComponentList) IsAllHidden() bool
IsAllHidden is something changed
type ComponentMetrics ¶
type ComponentMetrics struct {
X, Y float32
Height uint
// calculated
FontSize uint
Baseline uint
Width uint
X2, Y2 float32
// contains filtered or unexported fields
}
ComponentMetrics ,,
func (*ComponentMetrics) CoordinatesWithPadding ¶
func (metr *ComponentMetrics) CoordinatesWithPadding(t, r, b, l float32) (float32, float32, float32, float32)
CoordinatesWithPadding - top, right, bottom, left padding
func (*ComponentMetrics) RecalcFor ¶
func (metr *ComponentMetrics) RecalcFor(posX, posY float32, s string)
RecalcFor ..
type IndicatorWindow ¶
type IndicatorWindow struct { *glfw.Window Font *glfont.Font FontSize uint Position *Point Width, Height uint ScreenWidth, ScreenHeight uint // contains filtered or unexported fields }
IndicatorWindow for indicators
func NewIndicatorWindow ¶
func NewIndicatorWindow(width, height, position uint) (*IndicatorWindow, error)
NewIndicatorWindow ..
func (*IndicatorWindow) IsRunning ¶
func (iw *IndicatorWindow) IsRunning() bool
IsRunning - if channel is active then window is started
func (*IndicatorWindow) Terminate ¶
func (iw *IndicatorWindow) Terminate()
Terminate window and clean up resources. Must be called whenever program exists - on success or on error. There is no need to call this function if IndicatorWindow creation fails.
Click to show internal directories.
Click to hide internal directories.