Skip to content

Commit

Permalink
Merge pull request #84 from fyne-io/dweymouth-patch-1
Browse files Browse the repository at this point in the history
Deprecate GridWrap since it's available in Fyne main
  • Loading branch information
dweymouth committed Feb 16, 2024
2 parents 0b5901d + a8ea420 commit 61d0ff4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions widget/gridwrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ type GridWrapItemID = int
// GridWrap is a widget with an API very similar to widget.List,
// that lays out items in a scrollable wrapping grid similar to container.NewGridWrap.
// It caches and reuses widgets for performance.
//
// Deprecated: Since Fyne 2.4, GridWrap is available in Fyne core
type GridWrap struct {
widget.BaseWidget

Expand All @@ -37,13 +39,17 @@ type GridWrap struct {

// NewGridWrap creates and returns a GridWrap widget for displaying items in
// a wrapping grid layout with scrolling and caching for performance.
//
// Deprecated: Since Fyne 2.4, GridWrap is available in Fyne core
func NewGridWrap(length func() int, createItem func() fyne.CanvasObject, updateItem func(GridWrapItemID, fyne.CanvasObject)) *GridWrap {
gwList := &GridWrap{Length: length, CreateItem: createItem, UpdateItem: updateItem}
gwList.ExtendBaseWidget(gwList)
return gwList
}

// NewGridWrapWithData creates a new GridWrap widget that will display the contents of the provided data.
//
// Deprecated: Since Fyne 2.4, GridWrap is available in Fyne core
func NewGridWrapWithData(data binding.DataList, createItem func() fyne.CanvasObject, updateItem func(binding.DataItem, fyne.CanvasObject)) *GridWrap {
gwList := NewGridWrap(
data.Length,
Expand Down

0 comments on commit 61d0ff4

Please sign in to comment.