I've been wrestling over the weekend with creating a screen that moves or does actions based on buttons pressed, and I'm getting close to having it done, but in rare cases I'm seeing that more than one button reacts to a button being pushed. I'm trying to figure out why this could be the case. I've tried several ways to change the "action" part of the button code, but nothing seems to make a difference. Is there anything glaringly obviously wrong with this code?
screen lineButtonTest:
Code: Select all
def handleScreenClick():
selectedButton.handleClick()
screen lineButtonTest:
modal True
zorder 10
frame:
style_group "evidenceOverloadStyle"
xsize 3000
ysize 2000
#text str(testButton.buttonPos[0]) + "\n" + str(startPos[0])
#text str(testButton.lineEndPos[0]) + "\n" + str(endPos[0]) xpos 100
#text "[selectedAnswer]"
add screenLineRender
for item in buttonArray:
if item.type == "Answer" and item.selected == True and item.animationShown == False:
textbutton item.buttonText anchor (0.5, 0.5) style_group "evidenceOverloadStyleSelected" pos item.buttonPos action NullAction at movingDissolveButton(item.buttonPos, item.lineEndPos, item)
textbutton item.buttonText anchor (0.5, 0.5) pos item.buttonPos action [SetVariable("selectedButton", item), handleScreenClick] at None
at moveScreenAround(startPos, endPos)