Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to implement an "open pane" to an existing window (document)



If the images you show in these panes are conceptually part of the document, I suggest that the "document" object have some sort of panes element (though not named "panes"; the element name should be conceptual, like "thumbnails" or something). Each item of "thumbnails" should have a "hidden" property and an "image" property that is the thumbnail's default content. To add an image to the document, you'd tell the document to "make new thumbnail with data <imageFile>", or to remove an image, you'd say "delete thumbnail 3" or something. To show or hide the pane, you'd adjust the thumbnail's "hidden" property.

If the images are documents in their own right and you are just adjusting which window shows what documents, you'd use the "open" and "close" commands like you would for any document, and then use the "add" or "remove" commands to assign 'em to windows, like "add document 3 to window 1". In this case, the "window" object has to be modified so that it has an element "documents" instead of a property "document". This same principle would apply to the main image shown in each window; it would simply be "document 1 of window". You'll have to a) handle windows with no documents or b) disallow removing the last document from a window.

If the images aren't part of the document, but aren't really documents themselves, then you have to decide what they are, and add an appropriate element to the "window" class as described above. You'd still use "add" and "remove" if the images are shared amongst various windows; in that case, you'd also need a new element under "application" to be the One True Container for each image. Otherwise, you'd use "make" and "delete", except on an element of "window" rather than "document".



On 5 Sep 2006, at 12:26 PM, David Hoerl wrote:

I have an app where each window has a primary document (an image). It also supports the ability to open other images in separate panes (in split views).

I need to define a means to open these panes using AppleScript.

I've thought about it a bit, but no matter what the solution it seems like an odd duck.


PART A

1) I can tell the app to open a document with an optional parameter that indicates it should be done in a pane in the first window).

2) I can tell the first document to open another document.

3) I can tell the window to open a sub pane.

PART B

1) I can (try to) re-use the "open" command no matter which of the three above (or other) solution I use.

2) I can define a new command ("open pane" ?)



Suggestions would be most welcome.

David


PS: From an implementation standpoint, the current "Document" that is opened by NSApplication treats this first document as "special" - it shows the title in the window, and this document is not closable without closing the window. Beyond that its just the first entry an a possible array of images.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-implementors mailing list (Applescript- email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-implementors/d-j- email@hidden


This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-implementors mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/applescript-implementors/email@hidden

This email sent to email@hidden
References: 
 >How to implement an "open pane" to an existing window (document) (From: David Hoerl <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.