AppleScript-Studio Archive

List Statistics

  • Total Threads: 13
  • Total Posts: 23
  #1  
02-06-2010 11:02 PM
AppleScript-Studio member admin is online now
User
 

I have a panel that I need to display in the center of the screen in a modal fashion (no other objects outside of the window are accessible). The command that seems to work for this purpose is:

display window "theWindow"

However, it only seems to work with a Panel object, not a Window object. Using it with a Window object throws this error:

window "test" of «script» doesn’t understand the «event panSdisP» message. (-1708)

So, I have opted for the Panel object (which is fine with me) however, is displays the panel way off center at the bottom of the screen. I thought that I could just set the panel's initial postion to the center of the screen via Interface Builder, but that does not change the panel's position on display window "theWindow."

So, I am confused about how to solve this. Can anyone enlighten me on the uses of display window, display panel window, etc. and how they are meant to be used with Window objects vs. Panel objects?

Google has not been able to send me to the right Apple Developer doc that discusses this. Anyone know where one is?

Thanks,

John _______________________________________________
___________________________________________________

Posted on the AppleScript-Studio mailing list. Go to http://lists.apple.com/mailman/listinfo/applescript-studio to subscribe.

  #2  
03-06-2010 11:05 AM
AppleScript-Studio member admin is online now
User
 

Hi,

You just have to tell the window to center.
tell window "theWindow"
center
display
end

Andreas

On 03.06.2010, at 00:02, John Mistler wrote:

> I have a panel that I need to display in the center of the screen
> in a modal fashion (no other objects outside of the window are
> accessible). The command that seems to work for this purpose is:
>
> display window "theWindow"
>
> However, it only seems to work with a Panel object, not a Window
> object. Using it with a Window object throws this error:
>
> window "test" of «script» doesn’t understand the «event panSdisP»
> message. (-1708)
>
> So, I have opted for the Panel object (which is fine with me)
> however, is displays the panel way off center at the bottom of the
> screen. I thought that I could just set the panel's initial
> postion to the center of the screen via Interface Builder, but that
> does not change the panel's position on display window "theWindow."
>
> So, I am confused about how to solve this. Can anyone enlighten me
> on the uses of display window, display panel window, etc. and how
> they are meant to be used with Window objects vs. Panel objects?
>
> Google has not been able to send me to the right Apple Developer
> doc that discusses this. Anyone know where one is?
>
> Thanks,
>
> John _______________________________________________
___________________________________________________

Posted on the AppleScript-Studio mailing list. Go to http://lists.apple.com/mailman/listinfo/applescript-studio to subscribe.

  #3  
03-06-2010 06:51 PM
AppleScript-Studio member admin is online now
User
 

It is strange. Telling the window to center before (or even after displaying it) has no effect.

"show window" works perfectly (even without telling the window to center) because it is honoring the initial position settings. But I need this window to be modal.

call method "runModalForWindow:" doesn't work for centering it, either.

It seems that I am missing the cause of this, but don't know where to look for it.

Thanks,

John

On Jun 03, 2010, at 03:05 AM, Andreas Kiel wrote:

> Hi,
>
> You just have to tell the window to center.
> tell window "theWindow"
> center
> display
> end
>
> Andreas
>
> On 03.06.2010, at 00:02, John Mistler wrote:
>
>> I have a panel that I need to display in the center of the screen in a modal fashion (no other objects outside of the window are accessible). The command that seems to work for this purpose is:
>>
>> display window "theWindow"
>>
>> However, it only seems to work with a Panel object, not a Window object. Using it with a Window object throws this error:
>>
>> window "test" of «script» doesn’t understand the «event panSdisP» message. (-1708)
>>
>> So, I have opted for the Panel object (which is fine with me) however, is displays the panel way off center at the bottom of the screen. I thought that I could just set the panel's initial postion to the center of the screen via Interface Builder, but that does not change the panel's position on display window "theWindow."
>>
>> So, I am confused about how to solve this. Can anyone enlighten me on the uses of display window, display panel window, etc. and how they are meant to be used with Window objects vs. Panel objects?
>>
>> Google has not been able to send me to the right Apple Developer doc that discusses this. Anyone know where one is?
>>
>> Thanks,
>>
>> John _______________________________________________
___________________________________________________

Posted on the AppleScript-Studio mailing list. Go to http://lists.apple.com/mailman/listinfo/applescript-studio to subscribe.





NewsArc Lists  |  Culture Pages   |  Computing Archive  |  Media-Pages
Link to this page on your blog or website by copying the HTML code below and pasting it into your site: