# Command 0 does not seem to bring the Matlab command window to front

**URL:** https://psychtoolbox.discourse.group/t/command-0-does-not-seem-to-bring-the-matlab-command-window-to-front/985
**Category:** Uncategorized
**Created:** [February 22, 2007, 1:22am UTC](https://psychtoolbox.discourse.group/t/command-0-does-not-seem-to-bring-the-matlab-command-window-to-front/985 "2007-02-22T01:22:27Z")
**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: [February 22, 2007, 1:22am UTC](https://psychtoolbox.discourse.group/t/command-0-does-not-seem-to-bring-the-matlab-command-window-to-front/985/1 "2007-02-22T01:22:27Z")

</div>

Hi,  
  
I have a Dual G5 Mac with Matlab 7.1 SP3 with PsychToolbox 3.0.8. Firstly it seems that   
OpenWindow will ignore the rect argument to screen - is this desired behaviour? Secondly,   
once I have a full window I cannot seem to bring my Matlab command window to front.   
Command-zero doesn't work. This makes it hard to manually interact with the onscreen   
window.  
  
Does anyone else have this problem?  
  
Thanks for any help  
  
-Farhan

---

<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: [February 22, 2007, 8:34pm UTC](https://psychtoolbox.discourse.group/t/command-0-does-not-seem-to-bring-the-matlab-command-window-to-front/985/2 "2007-02-22T20:34:32Z")

</div>

Farhan,  
  
afaik, the rect argument is indeed ignored on the mac version (whether this is desired   
behaviour is something else....).  
  
Matlab will not come in front of the psychtoolbox window. That's how it is, and perhaps   
also desired behaviour (no accidental popping up of the commandwindow during an   
expeirment).  
There's two workarounds:  
use only complete scripts (or even better functions). make sure that there is a screen  
(closeall) command at the end. Check out the many demos for this.  
I find that the easiest way to work with ptb is using a dual monitor setup. One display will   
have the stimulus window, the other can hold the matlab command window. IN this way   
you coudl even do manual stuff.  
  
Hope this helps a bit.  
Gr.  
Frans  
  
  

> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "farhan\_rizwi" \<farhan\_rizwi@...\> wrote:  
> \>  
> \> Hi,  
> \>   
> \> I have a Dual G5 Mac with Matlab 7.1 SP3 with PsychToolbox 3.0.8. Firstly it seems that   
> \> OpenWindow will ignore the rect argument to screen - is this desired behaviour?   
> Secondly,   
> \> once I have a full window I cannot seem to bring my Matlab command window to front.   
> \> Command-zero doesn't work. This makes it hard to manually interact with the   
> onscreen   
> \> window.  
> \>   
> \> Does anyone else have this problem?  
> \>   
> \> Thanks for any help  
> \>   
> \> -Farhan  
> \>

---

<div class="post-metadata">

### Author: ![mariokleiner](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@mariokleiner](https://psychtoolbox.discourse.group/u/mariokleiner)
#### Post date: [February 23, 2007, 3:28pm UTC](https://psychtoolbox.discourse.group/t/command-0-does-not-seem-to-bring-the-matlab-command-window-to-front/985/3 "2007-02-23T15:28:40Z")

</div>

The 'rect' argument is ignored on OS-X, always fullscreen. I'm not sure if its desired   
behaviour from a users perspective, but its by design,nothing to be changed easily. Allen   
decided to use the CoreOpenGL API of OS/X, which allows for tight control of the graphics   
hardware - and for good timing, but it doesn't allow for windowed operation at all. The   
higher level AGL API would hav allowed for windowed mode, but would have provided less   
control and probably less accurate timing, so i guess it was a design decision in favor of   
robustness and timing accuracy, against convenience for single display users during   
debugging.  
  
best,  
-mario  
  

> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "franswcornelissen" \<f.w.cornelissen@...\> wrote:  
> \>  
> \> Farhan,  
> \>   
> \> afaik, the rect argument is indeed ignored on the mac version (whether this is desired   
> \> behaviour is something else....).  
> \>   
> \> Matlab will not come in front of the psychtoolbox window. That's how it is, and perhaps   
> \> also desired behaviour (no accidental popping up of the commandwindow during an   
> \> expeirment).  
> \> There's two workarounds:  
> \> use only complete scripts (or even better functions). make sure that there is a screen  
> \> (closeall) command at the end. Check out the many demos for this.  
> \> I find that the easiest way to work with ptb is using a dual monitor setup. One display   
> will   
> \> have the stimulus window, the other can hold the matlab command window. IN this way   
> \> you coudl even do manual stuff.  
> \>   
> \> Hope this helps a bit.  
> \> Gr.  
> \> Frans  
> \>   
> \>   
> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "farhan\_rizwi" \<farhan\_rizwi@\> wrote:  
> \> \>  
> \> \> Hi,  
> \> \>   
> \> \> I have a Dual G5 Mac with Matlab 7.1 SP3 with PsychToolbox 3.0.8. Firstly it seems   
> that   
> \> \> OpenWindow will ignore the rect argument to screen - is this desired behaviour?   
> \> Secondly,   
> \> \> once I have a full window I cannot seem to bring my Matlab command window to   
> front.   
> \> \> Command-zero doesn't work. This makes it hard to manually interact with the   
> \> onscreen   
> \> \> window.  
> \> \>   
> \> \> Does anyone else have this problem?  
> \> \>   
> \> \> Thanks for any help  
> \> \>   
> \> \> -Farhan  
> \> \>  
> \>
