Can't create Segmented Control using custom imagesheet

Hi,

I’m trying to create a segmented control using custom imagesheet and I keep getting this error:

[lua]2013-01-19 00:47:31.885 Corona Simulator[6650:f03] Runtime error:
2013-01-19 00:47:31.885 Corona Simulator[6650:f03] bad argument #1 to ‘find’ (string expected, got table)
stack traceback:
[C]: ?
[C]: in function ‘find’
?: in function ‘require’
?: in function ‘?’
?: in function <?:340>
(tail call): ?
/Users/krystian/projects/testowe/Buttons/main.lua:23: in main chunk[/lua]

error is coming from core, so I’m unable to debug :confused:

Here’s how I use it:

[lua]local segmentedControl = widget.newSegmentedControl({
width = 33,
height = 145,
sheet = imgSheet,
data = spriteInfo,
leftSegmentFrame = staticImageSheet.frameInfo[“left_up.png”],
leftSegmentSelectedFrame = staticImageSheet.frameInfo[“left_down.png”],
rightSegmentFrame = staticImageSheet.frameInfo[“right_up.png”],
rightSegmentSelectedFrame = staticImageSheet.frameInfo[“right_down.png”],
middleSegmentFrame = staticImageSheet.frameInfo[“middle_up.png”],
middleSegmentSelectedFrame = staticImageSheet.frameInfo[“middle_down.png”],
dividerFrame = staticImageSheet.frameInfo[“divider.png”],
segments = {“one”,“two”,“three”},

})[/lua]

where imgSheet is:
[lua]local imgSheet = graphics.newImageSheet(“buttons.png”, spriteInfo)[/lua]

and spriteInfo is:
[lua]{
frames = {
{ name = “divider.png”, x = 2, y = 2, width = 12, height = 148, sourceX = 0, sourceY = 0, sourceWidth = 11, sourceHeight = 148 }, – divider trimmed = true
{ name = “left_down.png”, x = 196, y = 2, width = 34, height = 146, sourceX = 0, sourceY = 0, sourceWidth = 33, sourceHeight = 145 }, – left_down trimmed = true
{ name = “left_up.png”, x = 160, y = 2, width = 34, height = 146, sourceX = 0, sourceY = 0, sourceWidth = 33, sourceHeight = 145 }, – left_up trimmed = true
{ name = “middle_down.png”, x = 124, y = 2, width = 34, height = 146, sourceX = 0, sourceY = 0, sourceWidth = 33, sourceHeight = 145 }, – middle_down trimmed = true
{ name = “middle_up.png”, x = 88, y = 2, width = 34, height = 146, sourceX = 0, sourceY = 0, sourceWidth = 33, sourceHeight = 145 }, – middle_up trimmed = true
{ name = “right_down.png”, x = 52, y = 2, width = 34, height = 146, sourceX = 0, sourceY = 0, sourceWidth = 33, sourceHeight = 145 }, – right_down trimmed = true
{ name = “right_up.png”, x = 16, y = 2, width = 34, height = 146, sourceX = 0, sourceY = 0, sourceWidth = 33, sourceHeight = 145 }, – right_up trimmed = true
},
sheetContentWidth = 256,
sheetContentHeight = 256
}[/lua]

Any ideas what am I doing wrong?

Thanks [import]uid: 109453 topic_id: 35092 reply_id: 335092[/import]

Hey Krystrian.

Your not doing anything wrong at all, this is a bug (that affects the other new widgets also). The good news is that it has been fixed and the fix will be available shortly.

Sorry for any inconvenience caused [import]uid: 84637 topic_id: 35092 reply_id: 139555[/import]

Hey Krystrian.

Your not doing anything wrong at all, this is a bug (that affects the other new widgets also). The good news is that it has been fixed and the fix will be available shortly.

Sorry for any inconvenience caused [import]uid: 84637 topic_id: 35092 reply_id: 139555[/import]