You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When removing tabs from a TabContainer this panic is thrown fyne.io/fyne/widget.(*TabContainer).RemoveIndex(...) C:/Users/Adrian/go/pkg/mod/fyne.io/fyne@v1.4.2/widget/tabcontainer.go:125 main.main.func3() C:/Users/Adrian/go/src/Test/main.go:16 +0x18f fyne.io/fyne/widget.(*Button).Tapped(0xc0000ca160, 0xc00008c0e0) C:/Users/Adrian/go/pkg/mod/fyne.io/fyne@v1.4.2/widget/button.go:196 +0xaa fyne.io/fyne/internal/driver/glfw.(*window).mouseClicked.func5() C:/Users/Adrian/go/pkg/mod/fyne.io/fyne@v1.4.2/internal/driver/glfw/window.go:738 +0x3f fyne.io/fyne/internal/driver/glfw.(*window).runEventQueue(0xc0000a8000) C:/Users/Adrian/go/pkg/mod/fyne.io/fyne@v1.4.2/internal/driver/glfw/window.go:1156 +0x83 created by fyne.io/fyne/internal/driver/glfw.(*gLDriver).createWindow.func1 C:/Users/Adrian/go/pkg/mod/fyne.io/fyne@v1.4.2/internal/driver/glfw/window.go:1180 +0x10d
It happens when the selected tab becomes out of range for the []items i.e. TabContainer.current > len(TabContainer.Items) - 1
I.E tabs A B C, select C, then remove C results in panic
I have also noticed that if the selected tab is removed and it is not out of range then the selected tab remains at the same value. Not sure if this is desirable behaviour. I.E tabs A B C, select B, then remove B. tabs become A B, and B is still selected.
Example code:
With this example follow the above instructions
`package main
Describe the bug:
When removing tabs from a TabContainer this panic is thrown
fyne.io/fyne/widget.(*TabContainer).RemoveIndex(...) C:/Users/Adrian/go/pkg/mod/fyne.io/fyne@v1.4.2/widget/tabcontainer.go:125 main.main.func3() C:/Users/Adrian/go/src/Test/main.go:16 +0x18f fyne.io/fyne/widget.(*Button).Tapped(0xc0000ca160, 0xc00008c0e0) C:/Users/Adrian/go/pkg/mod/fyne.io/fyne@v1.4.2/widget/button.go:196 +0xaa fyne.io/fyne/internal/driver/glfw.(*window).mouseClicked.func5() C:/Users/Adrian/go/pkg/mod/fyne.io/fyne@v1.4.2/internal/driver/glfw/window.go:738 +0x3f fyne.io/fyne/internal/driver/glfw.(*window).runEventQueue(0xc0000a8000) C:/Users/Adrian/go/pkg/mod/fyne.io/fyne@v1.4.2/internal/driver/glfw/window.go:1156 +0x83 created by fyne.io/fyne/internal/driver/glfw.(*gLDriver).createWindow.func1 C:/Users/Adrian/go/pkg/mod/fyne.io/fyne@v1.4.2/internal/driver/glfw/window.go:1180 +0x10d
It happens when the selected tab becomes out of range for the []items i.e. TabContainer.current > len(TabContainer.Items) - 1
I.E tabs A B C, select C, then remove C results in panic
I have also noticed that if the selected tab is removed and it is not out of range then the selected tab remains at the same value. Not sure if this is desirable behaviour. I.E tabs A B C, select B, then remove B. tabs become A B, and B is still selected.
Example code:
With this example follow the above instructions
`package main
import (
"fyne.io/fyne"
"fyne.io/fyne/app"
"fyne.io/fyne/widget"
)
func main() {
myApp := app.New()
myWindow := myApp.NewWindow("TabContainer Widget")
tabs := widget.NewTabContainer()
tabs.Append(widget.NewTabItem("Tab A", widget.NewButton("Remove A", func() { tabs.RemoveIndex(0) })))
tabs.Append(widget.NewTabItem("Tab B", widget.NewButton("Remove B", func() { tabs.RemoveIndex(1) })))
tabs.Append(widget.NewTabItem("Tab C", widget.NewButton("Remove C", func() { tabs.RemoveIndex(2) })))
tabs.SetTabLocation(widget.TabLocationTop)
myWindow.SetContent(tabs)
myWindow.Resize(fyne.NewSize(600, 600))
myWindow.ShowAndRun()
}
`
Device (please complete the following information):
The text was updated successfully, but these errors were encountered: