Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tab bar cannot be initialized with files due to undefined imageSheet variable #21

Open
mdsandell opened this issue Aug 16, 2021 · 0 comments · May be fixed by #22
Open

Tab bar cannot be initialized with files due to undefined imageSheet variable #21

mdsandell opened this issue Aug 16, 2021 · 0 comments · May be fixed by #22

Comments

@mdsandell
Copy link

You cannot call widget.newTabBar() with image files (not an image sheet), due to initWithImageFiles attempting to use (unnecessarily) an undefined "imageSheet" variable. I'm pretty sure this line can simply be deleted to fix the issue, but I'm not sure how to test this myself.

Example taken from documentation:

-- Create the widget
local tabBar = widget.newTabBar(
    {
        left = 0,
        top = display.contentHeight-120,
        width = 580,
        height = 120,
        backgroundFile = "tabBarBack.png",
        tabSelectedLeftFile = "tabBarSelL.png",
        tabSelectedRightFile = "tabBarSelR.png",
        tabSelectedMiddleFile = "tabBarSelM.png",
        tabSelectedFrameWidth = 40,
        tabSelectedFrameHeight = 120,
        buttons = tabButtons
    }
)

Failure:

Variable 'imageSheet' is not declared

File: /Users/vlad/actions-runner/_work/corona/corona/subrepos/widget/widgetLibrary/widget_tabbar.lua
Line: 227

stack traceback:
	[C]: in function 'error'
	strict.lua:24: in function <strict.lua:22>
	/Users/vlad/actions-runner/_work/corona/corona/subrepos/widget/widgetLibrary/widget_tabbar.lua:227: in function 'initWithImageFiles'
	/Users/vlad/actions-runner/_work/corona/corona/subrepos/widget/widgetLibrary/widget_tabbar.lua:851: in function </Users/vlad/actions-runner/_work/corona/corona/subrepos/widget/widgetLibrary/widget_tabbar.lua:754>
	(tail call): ?
	/Users/vlad/actions-runner/_work/corona/corona/subrepos/widget/widgetLibrary/widget.lua:135: in function </Users/vlad/actions-runner/_work/corona/corona/subrepos/widget/widgetLibrary/widget.lua:122>
	(tail call): ?
	main.lua:841: in function 'createTabBar'
	main.lua:873: in main chunk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant