nsviewcontroller

How to do collapse and expand view in mac application?

…衆ロ難τιáo~ 提交于 2019-12-07 22:43:27
I am new to mac application development, here i want to do expand and collapse view in my custom view(NSView) here the sample image How can i achieve these kind of collapse and expand cell in NSViewController not in NSWindow... Is it possible using NSTableView? I know its a simple question but i facing problem. Please suggest me some sample code or links.. Thanks Collapsing / expanding can be implemented by adjusting auto layout constraints in the action method of the disclosure triangle button. @property (nonatomic, weak) IBOutlet NSLayoutConstraint *moreInfoBoxHeight; [[self

Transition between windows in OS X [closed]

馋奶兔 提交于 2019-12-07 19:29:46
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I am going to make an OS X application with several views and windows. It has several screens - splash, login/register and the main screen(and so on). I tried to use NSWindowControllers. However, it's so complex

NSPopOver & NSViewController - Drag to resize

﹥>﹥吖頭↗ 提交于 2019-12-07 10:17:10
问题 I am making a MenuBar app for which I am using NSPopOver . The problem is that NSPopover uses NSViewController as a contentViewController , whose size gets fixed. My requirement is to make the size of NSViewController flexible i.e just like NSWindowController (set the minimum size and maximum depends upon the total screen size). In simple words how to change the size of NSViewController(NSPopOver) when user drags it. I am new to OS X programming. 回答1: I finally got it working by using Mouse

Handle close event of the window in Swift

萝らか妹 提交于 2019-12-07 03:10:07
问题 How to handle close event of the window using swift, for example, to ask "Are you sure you want to close the form?" The form will be closed in the case "yes" and not closed in the case "no". Showing message box is not a problem for me. viewWillDisappear() works for minimizing also, but I need only close event. Thanks. 回答1: Like said above, you should make the ViewController an NSWindowDelegate , but you should handle windowWillClose , not windowShouldClose . windowShouldClose is to determine

How to constrain second NSViewController minimum size in OS X app?

你。 提交于 2019-12-07 00:43:40
I am a novice Mac OS X developer. I assume this is an easy question, but I haven't been able to find any useful results via searches. How do I constrain the size of a SECOND view controller? I started with a simple Mac OS X app, with a single View Controller. I can select the window that contains the View Controller, then select the "Size Inspector" and check the "Minimum Content Size" box, and specify a minimum x and y for the window. This allows me to specify the minimum size for this first view controller, as I expect. All is good. Then I add a second view controller, with a Modal segue

How exactly does an NSView, an NSViewController, and MainMenu.xib fit together?

十年热恋 提交于 2019-12-06 11:35:44
问题 I'm going to cut right to the chase: my application has grown quite a bit, and now I think it's time for me to do some tidying up. I want to separate some of my views from my MainMenu.xib file into their own Nib file. The part that's tripping me up is the whole "Interface Builder + My Code" thing. Here's what I've done so far: I've added a view controller proxy object: In the Identity inspector, I've added my view controller's class name to the Custom Class field. In the Attributes inspector,

first mac app - push viewcontroller

自古美人都是妖i 提交于 2019-12-06 10:42:47
I have a question, I do some iphone application and now I want to do a little mac application. From a clean application I add a button on MainMenu xib, than I add a NSViewController to MainMenu (from IB) with one Action. I create a new NSViewController (FirstViewController) with a nib file and a button. Now I want only to create a function to push FirstController from MainMenu and a simple function to push MainMenu from FirstController. something like this ViewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:[NSBundle mainBundle]]; [self.navigationController

Cocoa app not loading views or running code on High Sierra

可紊 提交于 2019-12-06 06:31:51
问题 I have an app on the Mac AppStore and many users have recently written to say it doesn't work on High Sierra (possibly 10.13.6, its hard to extract specific information from them). I managed to reproduce the issue on a friend's device, however I won't be able to use the device to build with Xcode etc. The issue seems to be the NSViewController doesn't load it's subviews at all! The grey view controller shown below should have dropdowns and buttons in it. I also noticed that closing the grey

How to make embedded view controller part of the responder chain?

做~自己de王妃 提交于 2019-12-05 23:31:55
I am developing a Mac app using storyboards. I have a window that presents an NSViewController as its contents, which contains a "container view controller" that embeds an NSSplitViewController . The expected behaviour is for the NSSplitViewController to be part of the responder chain, such that a menu item that triggers the toggleSidebar action on the first responder actually collapses the item of the NSSplitViewController that's marked as a sidebar. However, this simply does not happen and the menu item remains disabled. So my question is, how can-I get the NSSplitViewController to be part

NSPopOver & NSViewController - Drag to resize

﹥>﹥吖頭↗ 提交于 2019-12-05 16:16:10
I am making a MenuBar app for which I am using NSPopOver . The problem is that NSPopover uses NSViewController as a contentViewController , whose size gets fixed. My requirement is to make the size of NSViewController flexible i.e just like NSWindowController (set the minimum size and maximum depends upon the total screen size). In simple words how to change the size of NSViewController(NSPopOver) when user drags it. I am new to OS X programming. I finally got it working by using Mouse Events . Just need to monitor the override func mouseDown(theEvent: NSEvent) {} override func mouseDragged