# display

**URL:** <https://psychtoolbox.discourse.group/t/display/723>\
**Category:** Uncategorized\
**Created:** [October 28, 2004, 12:18pm UTC](https://psychtoolbox.discourse.group/t/display/723 "2004-10-28T12:18:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Allen\_Ingling](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Allen\_Ingling](https://psychtoolbox.discourse.group/u/Allen_Ingling)\
**Post date:** [October 28, 2004, 12:18pm UTC](https://psychtoolbox.discourse.group/t/display/723/1 "2004-10-28T12:18:03Z")

</div>

Hello,  
  
I've just started learning using the Psychtoolbox and I want to create  
a programm which displays stimuli and records RT. I've created a  
subfunction "stimulus" which is called by a function "Test" and  
returns a RT. The problem I've encountered is that at the end of each  
stimulus presentation, the screen closes and matlab's screen appears  
for some msec. Is there a way to avoid this. I would be grateful for  
every advice.  
  
  
Thanks  
Pedro,  
Psychology student

---

<div class="post-metadata">

**Author:** ![anblick](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@anblick](https://psychtoolbox.discourse.group/u/anblick)\
**Post date:** [October 28, 2004, 3:30pm UTC](https://psychtoolbox.discourse.group/t/display/723/2 "2004-10-28T15:30:37Z")

</div>

It's impossible to know without seeing your code, but it sounds like   
what you are doing is opening and closing the PsychToolBox screen   
multiple times. You should open it once at the beginning of your   
experiment and close it at the end of your experiment. If you are   
using functions to display your stimuli, etc., you can pass the   
windowpointer to the function to draw to the screen you've already   
opened.  
  
keith  
  

> On Oct 28, 2004, at 8:18 AM, pdr\_cardoso wrote:  
>    
> \>  
> \>  
> \>  
> \>  
> \> Hello,  
> \>  
> \> I've just started learning using the Psychtoolbox and I want to create  
> \> a programm which displays stimuli and records RT. I've created a  
> \> subfunction "stimulus" which is called by a function "Test" and  
> \> returns a RT. The problem I've encountered is that at the end of each  
> \> stimulus presentation, the screen closes and matlab's screen appears  
> \> for some msec. Is there a way to avoid this. I would be grateful for  
> \> every advice.  
> \>  
> \>  
> \> Thanks  
> \> Pedro,  
> \> Psychology student  
> \>  
> \>  
> \>  
> \>  
> \>  
> \>  
> \>  
> \>  
> \>  
> \> Post your message to: [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com)  
> \> Please indicate OS9, OSX, or WIN version, and include your full name.  
> \> Denis Pelli, David Brainard, and Allen Ingling.  
> \> [http://psychtoolbox.org](http://psychtoolbox.org)  
> \>  
> \> Yahoo! Groups Links  
> \>  
> \>  
> \>  
> \>  
> \>  
> \>  
> \>

---

<div class="post-metadata">

**Author:** ![franswcornelissen](https://avatars.discourse-cdn.com/v4/letter/f/df705f/32.png) [@franswcornelissen](https://psychtoolbox.discourse.group/u/franswcornelissen)\
**Post date:** [October 28, 2004, 3:34pm UTC](https://psychtoolbox.discourse.group/t/display/723/3 "2004-10-28T15:34:08Z")

</div>

Pedro,  
  
Most likely you're using the 'openwindow' and 'closewindow' command within your   
stimulus subfunction (which do what their names suggest ;-). What you want to do is open   
a window in your main (test) function, and pass only the window pointer to your stimulus   
function. Within your stimulus function use e.g. the 'fillrect' command to clear your screen.  
  
(next time you post a question, please indicate on which system your working.)  
  
Gr.  
Frans Cornelissen  
  

> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "pdr\_cardoso" \<pdr\_cardoso@y...\> wrote:  
> \>   
> \>   
> \>   
> \> Hello,  
> \>   
> \> I've just started learning using the Psychtoolbox and I want to create  
> \> a programm which displays stimuli and records RT. I've created a  
> \> subfunction "stimulus" which is called by a function "Test" and  
> \> returns a RT. The problem I've encountered is that at the end of each  
> \> stimulus presentation, the screen closes and matlab's screen appears  
> \> for some msec. Is there a way to avoid this. I would be grateful for  
> \> every advice.  
> \>   
> \>   
> \> Thanks  
> \> Pedro,  
> \> Psychology student
