button.go 575 B

1234567891011121314151617181920
  1. package winman
  2. // ButtonSide determines the alignment of a window button
  3. type ButtonSide int16
  4. const (
  5. // ButtonLeft will set the button to be drawn on the left
  6. ButtonLeft = iota
  7. // ButtonRight will set the button to be drawn on the right
  8. ButtonRight
  9. )
  10. // Button represents a button on the window title bar
  11. type Button struct {
  12. Symbol rune // icon for the button
  13. offsetX int // where the button is drawn
  14. offsetY int
  15. Alignment ButtonSide // alignment of the button, left or right
  16. OnClick func() // callback to be invoked when the button is clicked
  17. }