Documentation
¶
Index ¶
- func ToNRGBA(c color.Color) (r, g, b, a int)
- type ImageButton
- func (imageButton *ImageButton) CreateRenderer() fyne.WidgetRenderer
- func (imageButton *ImageButton) Cursor() desktop.Cursor
- func (imageButton *ImageButton) FocusGained()
- func (imageButton *ImageButton) FocusLost()
- func (imageButton *ImageButton) MinSize() fyne.Size
- func (imageButton *ImageButton) MouseIn(*desktop.MouseEvent)
- func (imageButton *ImageButton) MouseMoved(*desktop.MouseEvent)
- func (imageButton *ImageButton) MouseOut()
- func (imageButton *ImageButton) SetImage(image fyne.Resource)
- func (imageButton *ImageButton) SetText(text string)
- func (imageButton *ImageButton) Tapped(*fyne.PointEvent)
- func (imageButton *ImageButton) TypedKey(ev *fyne.KeyEvent)
- func (imageButton *ImageButton) TypedRune(rune)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ImageButton ¶
type ImageButton struct {
widget.DisableableWidget
Text string
Image fyne.Resource
Importance widget.ButtonImportance
Alignment widget.ButtonAlign
IconPlacement widget.ButtonIconPlacement
OnTapped func() `json:"-"`
// contains filtered or unexported fields
}
ImageButton widget has a text label and a background image that triggers an event func when clicked
func NewImageButton ¶
func NewImageButton(text string, image fyne.Resource, tapped func()) *ImageButton
func (*ImageButton) CreateRenderer ¶
func (imageButton *ImageButton) CreateRenderer() fyne.WidgetRenderer
CreateRenderer is a private method to Fyne which links this widget to its renderer
func (*ImageButton) Cursor ¶
func (imageButton *ImageButton) Cursor() desktop.Cursor
Cursor returns the cursor type of this widget
func (*ImageButton) FocusGained ¶
func (imageButton *ImageButton) FocusGained()
FocusGained is a hook called by the focus handling logic after this object gained the focus.
func (*ImageButton) FocusLost ¶
func (imageButton *ImageButton) FocusLost()
FocusLost is a hook called by the focus handling logic after this object lost the focus.
func (*ImageButton) MinSize ¶
func (imageButton *ImageButton) MinSize() fyne.Size
MinSize returns the size that this widget should not shrink below
func (*ImageButton) MouseIn ¶
func (imageButton *ImageButton) MouseIn(*desktop.MouseEvent)
MouseIn is called when a desktop pointer enters the widget
func (*ImageButton) MouseMoved ¶
func (imageButton *ImageButton) MouseMoved(*desktop.MouseEvent)
MouseMoved is called when a desktop pointer hovers over the widget
func (*ImageButton) MouseOut ¶
func (imageButton *ImageButton) MouseOut()
MouseOut is called when a desktop pointer exits the widget
func (*ImageButton) SetImage ¶
func (imageButton *ImageButton) SetImage(image fyne.Resource)
SetImage updates the image on the image button - pass nil to hide the image.
func (*ImageButton) SetText ¶
func (imageButton *ImageButton) SetText(text string)
SetText allows the button label to be changed
func (*ImageButton) Tapped ¶
func (imageButton *ImageButton) Tapped(*fyne.PointEvent)
Tapped is called when a pointer tapped event is captured and triggers any tap handler
func (*ImageButton) TypedKey ¶
func (imageButton *ImageButton) TypedKey(ev *fyne.KeyEvent)
TypedKey is a hook called by the input handling logic on key events if this object is focused.
func (*ImageButton) TypedRune ¶
func (imageButton *ImageButton) TypedRune(rune)
TypedRune is a hook called by the input handling logic on text input events if this object is focused.