visual.ButtonStim not working

Hi - does anyone know how to display a button defined via visual.ButtonStim? I have the most basic code -

Button = visual.ButtonStim(myWin, text=‘B’, font=‘Arvo’, name = “plya”)
Button.setPos([170, 170])

my spatial units is pix and all the other shapes i have made so far display properly.

Do TextBox2 objects work?

ButtonStim is basically a tweaked version of TextBox2, so if those work, it’s not clear why buttons wouldn’t. On the other hand, if neither of them work, then it’s something about TextBox2, and we’d need to pin down what.

It might also be an autoDraw issue if you are using autoDraw rather than calling draw() on every flip. It looks like the implementation of Button might not carry over that property into the TextBox2 object it creates, so you may have to manually call draw() for the Button object.

Worst case you can always spoof it with a shapestim and a textstim.

1 Like

Thanks so much! It’s an autodraw() issue :slight_smile:

1 Like

Great! I’ll file a quick bug report about it so ButtonStim gets a working autoDraw property in the future.