> On 10/06/2015, at 13:38, Zach Howard <
how...@gmail.com> wrote:
>
> Thanks Michael, I'm unforunately using the Builder interface as I'm not proficient enough to use the coder, but this sounds promising! Could you perhaps give me a little direction as to how I might implement it through the builder? At the moment, for my 'Text Input' event, I have a text event with "$('\n' + inputText)" as the 'text', and a code event that dynamically updates 'inputText' as the user presses keys. I found this on these forums and on the gitHub page (I think perhaps you were even the one who provided it?).
>
> How would I go about changing this event so that it was a TextBox instead?
Delete your existing graphical text stimulus component. In its place, you will need to create and then update a TextBox stimulus entirely in code. I've never actually used a TextBox, so take all of this with a pinch of salt.
It seems you already have a Code component. In its "Begin Experiment" tab, put something like this:
# amend the settings to be whatever you need:
textBox_1 = visual.TextBox(window=win,
text='Hello, some dummy text to be replaced later',
font_size=21,
font_color=[-1,-1,1],
size=(0.5,0.25),
pos=(0.0,0.0),
grid_horz_justification='center',
units='norm',
)
Then in your existing code, after you create the variable 'inputText', insert this:
textBox_1.setText(inputText)
textBox_1.draw()
Having said that, I just tried to run the Coder TextBox demos, and they all fail like this:
File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/demos/coder/stimuli/textBoxStim/textbox_glyph_placement.py", line 31, in <module>
textbox=visual.TextBox(window=window,
AttributeError: 'module' object has no attribute 'TextBox'
** It looks like TextBox has fallen foul of some of the recent re-organisation of stimuli in the source code. Any comment from other developers on this? **
Regards,
Michael