Upgrade to v2.5
Fyne API v2.5
app
canvas
container
data/binding
data/validation
dialog
driver
driver/desktop
driver/mobile
driver/software
lang
layout
storage
storage/repository
test
theme
widget
package widget
Accordion
AccordionItem
Activity
BaseWidget
Button
ButtonAlign
ButtonIconPlacement
ButtonImportance
ButtonStyle
Card
Check
CheckGroup
CustomTextGridStyle
DisableableWidget
Entry
FileIcon
Form
FormItem
GridWrap
GridWrapItemID
Hyperlink
HyperlinkSegment
Icon
ImageSegment
Importance
Label
List
ListItemID
ListSegment
Menu
Orientation
ParagraphSegment
PopUp
PopUpMenu
ProgressBar
ProgressBarInfinite
RadioGroup
RichText
RichTextBlock
RichTextSegment
RichTextStyle
Select
SelectEntry
Separator
SeparatorSegment
Slider
Table
TableCellID
TextGrid
TextGridCell
TextGridRow
TextGridStyle
TextSegment
Toolbar
ToolbarAction
ToolbarItem
ToolbarSeparator
ToolbarSpacer
Tree
TreeNodeID
Fyne API "widget.Icon"
widget.Icon
import "fyne.io/fyne/v2/widget"
Usage
type Icon
type Icon struct {
BaseWidget
Resource fyne.Resource // The resource for this icon
}
Icon widget is a basic image component that load’s its resource to match the theme.
func NewIcon
func NewIcon(res fyne.Resource) *Icon
NewIcon returns a new icon widget that displays a themed icon resource
func (*Icon) CreateRenderer
func (i *Icon) CreateRenderer() fyne.WidgetRenderer
CreateRenderer is a private method to Fyne which links this widget to its renderer
func (*Icon) MinSize
func (i *Icon) MinSize() fyne.Size
MinSize returns the size that this widget should not shrink below
func (*Icon) SetResource
func (i *Icon) SetResource(res fyne.Resource)
SetResource updates the resource rendered in this icon widget