nspopover

Open NSPopover in windowDidLoad

不羁岁月 提交于 2019-12-13 03:36:59
问题 I am trying to display an NSPopover in a mac application when the window opens to give the user an instruction, but the popover will not display. If I call the exact same function from a button press then the popover successfully displays, but when I call it in windowDidLoad it doesn't. I can see that the control I am presenting it from has a bounds, so I don't think that is the problem. I've also checked that the behaviour of the popover is not transient, so it shouldn't close without

Show NSPopover without Focus

无人久伴 提交于 2019-12-13 02:59:08
问题 I'm working on creating an IntelliSense style popover that shows the user who is typing into a text field what syntax is valid. Does anyone know how to show an NSPopover without giving it focus, so that the user can continue to type into the textField? The popover is triggered by controlTextDidChange: - (void) controlTextDidChange:(NSNotification *)obj { NSTextField *field = [obj object]; NSString *command = [field stringValue]; if ([[command substringFromIndex: command.length - 1]

NSTextField not active in NSPopOver

╄→гoц情女王★ 提交于 2019-12-12 14:33:09
问题 I have a menubar application, which open a popover. That popover contains NSTextField and few buttons. The problem is that the NSTextField is non-selectable, it's impossible to type anything in it. However, it's possible to click on it with mouse right button and paste something. Well, that's definitely odd behavior. Buttons works without any problems in that popover, btw. Here's the code i use: - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { [NSApp

NSTextField inside NSPopover is not key until mouse click

隐身守侯 提交于 2019-12-12 10:09:04
问题 I've got an NSPopover that is shown from interaction with an NSStatusItem. I've blogged about the hacks I needed to do to make input even possible in this situation here: http://blog.brokenrobotllc.com/using-nspopover-with-nsstatusitem I have an NSTextField inside the NSPopover's content view. When I open the NSPopover, the NSTextField appears as if it is key (the cursor blinks). But, when typing, nothing shows up. If I click the mouse in the field, my input starts showing up there. I've

NSPopover to start in a detached state

夙愿已清 提交于 2019-12-12 08:09:54
问题 Is there a way to force the NSPopover to start in the detached state? I only see isDetached which is a read-only property for the state of the popover and an NSPopoverDelegate method detachableWindow(forPopover:) which lets me override the window that gets created. I'd like to essentially click a button and have the NSPopover start in the state in this photo. The style of this window is exactly what a product requirement is and I can't seem to find any NSWindow style settings that would make

How to Close NSPopover programmatically

僤鯓⒐⒋嵵緔 提交于 2019-12-11 17:47:22
问题 I want to know how to close NSPopover programmatically, not by touching outside, because I want to assign it to an action (such as KeyDown Enter Key or other shortcut) because I open my NSPopover with a shortcut, it would be more logical to close by pressing another command going to share my code: EdiciondeCuentasWC.h (NSWindowController) from where I call my NSPopover #import "EdicionDeCuentasWC.h" #import "CambiarTipoCuentaVC.h" @interface EdicionDeCuentasWC ()<NSPopoverDelegate>{

Emoji List in NSPopover on macOS like Messages App

时光总嘲笑我的痴心妄想 提交于 2019-12-11 08:57:31
问题 I want to show an NSPopover in my Mac app that lists the emoji just like Apple's Messages app does like this: All I can figure out so far is that I can show the character palette in my app using this: NSApp.orderFrontCharacterPalette(nil) But that shows the palette as a separate window like this: Does anyone know how I can embed the character palette in an NSPopover and retrieve the selected emoji in my app (similar to how Apple does it in Messages)? 回答1: Set your textView, textField, or any

View based NSTableView with each view contains 3 labels with should resize based on Text

依然范特西╮ 提交于 2019-12-10 23:36:45
问题 I need to create a view based tableview in Popover as specified below: Tableview should be placed in Popover(Popover height should be same as tableview). Each row should contain a view. Each row view will contain 3 labels. Labels should be auto re sizable based on its text height. Based on 3 labels height, Cell row height should resize. Based on all cell rows, tableview height should resize. Based on tableview height, Popover should resize. I have done this in a static format, but i need to

NSPopover color

╄→гoц情女王★ 提交于 2019-12-09 10:26:58
问题 Is there any way to color NSPopover? Ive seen apps like facetab etc that have cool colors and resizeable popovers, how is this done? Ay guides, hints? Thanks. 回答1: You can use MAAttachedWindow instead. 回答2: Set popover.contentViewController.view as a subclass of NSView with a custom background drawing (i.e. override drawRect: and fill a rect with your custom background color). Then set the popover.appearance = NSPopoverAppearanceHUD to remove the default border around the view. Note that

How to make action to close NSPopover?

北城以北 提交于 2019-12-08 14:58:14
问题 Hi I implemented an NSPopover in one of my apps, but the popover will not close. I'm guessing that it should close once I click something else, but its not. I know that there's a close popover action but that only works for a different button. How can I make it look to see that the popover is open and when it is open to close the popover when I press the same button? 回答1: I solved the problem! First go ahead and click your .xib file. Where you see the first responder box and files owner -