How to make a window like this
MacBook Pro with Retina display, OS X Mountain Lion (10.8.4)
You can make a difference in the Apple Support Community!
When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.
When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.
If you are using a Cocoa-AppleScript template, you have some work to do. Since the Interface Editor isn't available, you are going to have to do everything by hand. One way I've found that makes it a little easier is to create the UI in the Interface Editor, then look at the raw nib/xib file to see what the numbers are.
From the Interface Editor in an AppleScriptObjC Xcode project, there is a Window and Drawer object that you can drag from the library. This has a Drawer Content View that you can put your other objects in. In your screenshot the view has a label, a text field, a popup button, and an NSOutlineView.
If you are using a Cocoa-AppleScript template, you have some work to do. Since the Interface Editor isn't available, you are going to have to do everything by hand. One way I've found that makes it a little easier is to create the UI in the Interface Editor, then look at the raw nib/xib file to see what the numbers are.
From the Interface Editor in an AppleScriptObjC Xcode project, there is a Window and Drawer object that you can drag from the library. This has a Drawer Content View that you can put your other objects in. In your screenshot the view has a label, a text field, a popup button, and an NSOutlineView.
Okey but how can I activate Custom View there is no action for MakeKeyAndOrderFront:
The window has the makeKeyAndOrderFront method, but the drawer view does not, since it is attached to the window - see the NSDrawer Class Reference.
Okey I found it it's in the bindings and only one bind is available "Visable" Doh! with a very basic script I can activate it
on click_(sender)
if x = false then
set my x to true
else
set my x to false
end if
end click_
There are two question: 1) What if I want to make second custom view 2)How I will add Drawers to my Main Project
And I know you're helping me a lot in cocoa-applescript but I need to ask you one more thing... I looked Documention, Internet but I couldn't find anything. Every topic that I've found is for AppleScript Studio (I know you know it since 1978 😀). How can I set dataSource for Outline View. I'm trying to show playlist folders and playlists in it. Actually I found how to show drawer when I post my lastest reply but Apple Discussions get into maintance 😀.
1) You can create whatever views you want, then use NSDrawer's setContentView: method to set the desired view before opening the drawer.
2) You can try to convert AppleScript Studio, since the various predefined handlers are basically wrappers around the equivalent Cocoa methods, but your best bet would be to use the Objective-C documentation - Outline View Programming Topics, for example. You will need to learn to read the Objective-C method declarations (and know your way around Cocoa), but the conversion to AppleScriptObjC is fairly easy.
Okey I add the window and drawer then I deleted window after I set drawer's parentWindow to my main window. Now it's working well I can open it with toogle: But I have a problem when I build my app my drawer seems more smaller then normal.
A drawer can't be larger than its parent window - see Drawer Programming Topics.
How to make a window like this