Search Results

Search found 63 results on 3 pages for 'nswindow'.

Page 1/3 | 1 2 3  | Next Page >

  • NSWindow NSResizableWindowMask resize corner wrong place

    - by Ziggy
    Hello, if i use NSResizableWindowMask flag in my NSWindow the "resize corner glyph" is on the top right. I can resize when pointing on the lower right corner. I use a own created NSView with it, and set it as content view with setContentView method. I ' dont use a bottom bar. Any idea of what i'm doing wrong ? Thanks.

    Read the article

  • Cocoa NSWindow not updating with data

    - by Matt S.
    I have an NSWindow that shows up when you click either of two items (both from an NSTableView). I have a setter method that tells the window what information to display. This all works perfectly, until it comes time to display the data in the window. If I cause the window to display from one tableview, then try to have it display the new data from another it doesn't do it, it keeps the old data on. I am using the exact same method to get and display the data from both possible ways to have the window show up, and the data is changing correctly. To display the window I'm using [mywindow makeKeyAndOrderFront:self];

    Read the article

  • Return NSWindow to Normal Level

    - by PF1
    Hi Everyone: I have an NSWindow that I want to go above the captured kCGDirectMainDisplay when a function is run and have the window go back to its normal level after the display is released. My code works for capturing the display, setting the window's level, and releasing the display, however once the display is released, the window floats above all other windows. I have included my method of doing this, in case I am doing something wrong. Capture the display CGDisplayCapture(kCGDirectMainDisplay); [self.window setLevel:CGShieldingWindowLevel()]; Release the display CGDisplayRelease(kCGDirectMainDisplay) [self.window setLevel:NSNormalWindowLevel]; Thanks for any help!

    Read the article

  • NSWindow does not respond to keystroke command-s

    - by wackazong
    Hello, it may pre very simple, but cannot find it: I have three windows in three separate NIBs in my application. One is opened when a new document is opened, the other two can be opened from the program's window menu. The problem is: two windows (in them the one that is opened at the beginning) accepts the normal keystroke as for example command-s for save, and the other one does not and gives a warning sound instead. I cannot figure out the difference between the two windows or their controllers. I know it will have to do with the responder chain, but I am left clueless. Any ideas? Thanks, wackazong

    Read the article

  • Save NSWindow Size on Resize & Close For User

    - by incarna
    I've noticed that all applications on OS X seem to save the size you set it at. The next time you open it it's typically in the same position and size. I'm making an app and I've noticed that after resizing, if I launch the application again it's just the size of what I've set in Xcode 4's IB and not the size that I resized it to on launch. Do I have to manually save the window size each time its changed? Or is there an easier way to do this through IB? (My window does have a minimum size set if that changes anything.)

    Read the article

  • Custom NSStatusItem with custom view - Use NSWindow, NSView, custom NSMenuItem?

    - by Luc
    I'm trying to create a LSUIElement app that behaves like Spotlight, CoverSutra and other apps of that type. I managed to create a custom NSStatusItem, which popups up an NSWindow but the problem is that the app that currently has focus will the focus to my custom NSWindow. I've based myself on Matt Gemmell's example (http://mattgemmell.com/2008/03/04/using-maattachedwindow-with-an-nsstatusitem) For example, if you're in Safari and click on the Spotlight icon, the current Safari window does not gray out and keeps focused. When you press ESC in Spotlight, the focus is back to the Safari window. I haven't managed to do this with my custom NSWindow. I have to click back on a window to set focus back to it. So I'd like to know which route to go to achieve this. Is the solution a NSWindow, NSPanel, NSMenu with a custom NSMenuItem?

    Read the article

  • When an NSWindow object has a delegate that is a NSWindow subclass, who is responsible to act on received events?

    - by spade78
    So I'm building a program that features the use of the IKImageBrowserView component as a subview in an NSWindow. As a side note, I have a controller object called ImageBrowserController which subclasses NSWindow and is set as the delegate of the NSWindow object of my app. I have sent IKImageBrowserView the message setCanControlQuickLookPanel:YES to enable it to automatically use the QuickLook functionality to preview image files when the IKImageBrowserView is a first responder to receive key events. Then it took me a while to figure out how to make the IKImageBrowserView a first responder which I finally got working by overriding acceptsFirstResponder inside my ImageBrowserController. Now I understand that as the delegate to the NSWindow, ImageBrowserController has a place in the responder chain after the event gets triggered on NSWindow. And I understand that as a subview of NSWindow, IKImageBrowserView is in line to be passed events for event handling. What I don't get is where the connection is between the ImageBrowserController being a first responder and the event somehow making it to the IKImageBrowserView. I didn't set NSWindow or IKImageBrowserView as first responders explicitly. So why isn't it necessary for me to implement event handling inside my ImageBrowserController? EDIT: So after reading the accepted answer and going back to my code I tried removing the acceptsFirstResponder override in my ImageBrowserController and the QuickLook functionality still triggered just like the accepted answer said it would. Commenting out the setCanControlQuickLookPanel:YES made the app beep at me when I tried to invoke QuickLook functionality via the spacebar. I'm getting the feeling that my troubles were caused by user error of XCode in hitting the RUN button instead of the BUILD button after making changes to my code (sigh).

    Read the article

  • cocoa -- What is the proper way to tell an NSWindow to redisplay its contents?

    - by William Jockusch
    According to the NSWindow Class Reference, you should "rarely need to invoke" the NSWindow methods "display" or "setViewsNeedDisplay". So what is the usual way to redisplay the window's contents? EDIT: I am having trouble dealing with resizing events. I just want to have everything scale proportionally. See this question. As no one seems to have any ideas for using masks to get it to happen, I want to redraw the whole thing.

    Read the article

  • Unclickable NSWindow?

    - by Brock Woolf
    I have an NSWindow in a Cocoa application with a fullscreen OpenGL context running above it. The NSWindow (is loaded from the default nib). It contains some buttons, but when I try to click them they do not press down as a normal aqua button does. I think this could have something to do with the first responder, but i'm not 100% sure. I can move the NSWindow around by it's title bar, but nothing inside it is clickable, nor are there any changes on rollover of the close and minimise buttons. How do I make my NSWindow (and the objects inside it) 'clickable'?

    Read the article

  • Display NSWindow as Subview of NSView...

    - by Nano8Blazex
    I have an NSWindow that I want to display as part of another window. It has to be an NSWindow; I don't want to change it to an NSView or anything... I just don't because it involves accessing foreign nib files and the such. How should I accomplish this if possible? I was thinking along the lines of grabbing the view of the NSWindow and sticking it as the subview of another view in my main window... but I don't think this is possible. Is it?

    Read the article

  • Why does my NSWindow only receive mouseOver events the first time?

    - by DanieL
    I have an application where a borderless window is shown and hidden, using orderOut and orderFront. When it is visible, I want the it to become the key window when the mouse moves over it. So far I've done this: In awakeFromNib I have set its first responder to itself. In the window's constructor I set accepts mouse events to YES. In the mouseMoved method, I use makeKeyAndOrderToFront. My problem is, that this only works the first time I move the mouse over the window. After that, it doesn't receive any mouseOver events. I've tried checking the firstResponder but as far as I can tell it never changes from the window. Any ideas what I can do to get this working?

    Read the article

  • Pointer to NSWindow Xib after loading it?

    - by Brock Woolf
    In my code below, CustomWindow is a subclass of NSWindow. CustomWindow *window = [[CustomWindow alloc] init]; if (![NSBundle loadNibNamed:@"NibName" owner:window]) [window center]; // doesn't work How do you get a pointer to control your XIB after you load it so you can do things such as centering the XIB? What am i doing wrong here?

    Read the article

  • Warning: XXX may not respond to YYY

    - by Aurel300
    Hey, I am making some stuff in Objective-C++... And I must say that I am a total newbie when it comes to the Objective-C part... I don't really want to learn it, I kinda just need it for accessing a few Mac APIs (ObjC is such a dumb language). So - compiling with g++ -x objective-c++ - and I somehow keep getting this warning: XXX may not respond to YYY First it was with a NSScreen, now it is with a NSWindow: NSWindow may not respond to +initWithContentRect:styleMask:backing:defer: I saw somewhere that I should cast it to id, but didn't work, throwing absolutely cryptic errors... So - WHAT does this warning actually mean and HOW am I supposed to make it stop?

    Read the article

  • How to control a NSView, located in a dedicated NSWindow, from the main NSWindow designed to support

    - by Michael
    Hi, This is probably a simple problem for the high skilled Cocoa programmers, but I can't find how to control the graph in a separate window. I read carefully the Cocoa related books, go through many web notes,but I can't find a solution to my problem. The purpose is to use a dedicated window to draw the I=F(Vg) curves extracted by the GUI from a specific hardware. All the GUI and the hardware works fine ( thanks to the help provided by several members of stackoverflow) , but no way to send the parameters to the NSView to display the results. So far, the GUI class is based on a NSObject, the graphic class is NSView. Any idea, examples, links will be appreciated. Thank you so much. Michael

    Read the article

  • Setting Position of NSWindow before Display

    - by Armin Ronacher
    Right now I'm setting the position of a window that is about to open like this: -(void) setActiveNodeDialog:(ISKNodeDialogController *)dialog { if (activeNodeDialog) [[activeNodeDialog window] close]; activeNodeDialog = dialog; if (activeNodeDialog) { [activeNodeDialog setMainWindowController:self]; NSRect windowRect = [[self window] frame]; NSRect dialogRect = [[activeNodeDialog window] frame]; NSPoint pos; pos.x = windowRect.origin.x + windowRect.size.width - dialogRect.size.width - 10; pos.y = windowRect.origin.y + 32; [[activeNodeDialog window] setFrameOrigin:pos]; [[activeNodeDialog window] makeKeyAndOrderFront:nil]; } } The problem with that is, that the window will "jump" when shown. And that even though I set the position before showing the window with "makeKeyAndOrderFront". The window is a NSPanel *. Anyone any ideas how to fix the jumping? Setting the position in awakeFromNib is not an option because the main controller is set later.

    Read the article

  • Cocoa class not displaying data in NSWindow

    - by Matt S.
    I have one class that controls one window, and another class that controls a different window in the same xib, however, the second window never displays what it should. In the first class I alloc and init the second class, then pass some information to it. In the second class it displays that data in the table view. Yes, in the .xib I have all the connections set up correctly, I've quadruple checked. Also the code is correct, same with the connections, I've quadruple checked.

    Read the article

  • Using NSWindow or NSPanel as "CardLayout"

    - by Leandro
    How guys. I'm not top dev in java, but what I`m really not is cocoa top dev :P I would like to have your assistance to produce a layout with cocoa and IB to work just like the CardLayout in Java. Do you have some idea of how to do it? Thanks for the attention! EDIT: CardLayout: A set of panels ("cards") are designed to compose a "deck of cards".It works like a queue of panels, in which only the first "card" is shown on the interface.I can easily interchange between cards if I want so to modify the interface to the user. I hope I could help you to help me. =)

    Read the article

  • Window 'onscreen' size puzzle

    - by Bender
    Okay, a REALLY fundamental question about window sizes here... If I create an NSWindow in IB, set its size to 216 x 144 points (exactly 3 inches by 2 inches) then print the window, it measures exactly what I set it to in IB. However, the onscreen display size measures approximately 156 x 105 points. What causes this, and is there any way to force the window to display at the required size onscreen? I ultimately want to draw to this (semi-transparent) window then use it as a full-sized overlay for comparison against a separately loaded scanned image of known size.

    Read the article

  • Snow Leopard & LSUIElement -> application not activating properly, window not "active" despite being

    - by Frank R.
    Hi, I'm running into a few problem with a background application that uses LSUIElement=1 to hide its dock item, menu bar and prevent it from appearing in the Command-Tab application switcher. It seems to be a Snow Leopard only problem. The application places an NSStatusItem in the menu bar and pops up a menu when clicked on. Selecting "Preferences..." should bring up an NSWindow with the preferences. The first thing that doesn't seem to work is that the Window does not get ordered in at the front, but appears behind all other application windows. I tried to fix this by calling [[NSApplication sharedApplication] activateIgnoringOtherApps: YES] but that didn't work. After a while I figured out that the menu is blocking the message to the run loop from being sent, so I wrote another method on the MainController and sent the message with a delay: [self performSelector:@selector(setFront:) withObject: [preferencesController window] afterDelay:1.0]; -(void)setFront: (id) theWindow { [[NSApplication sharedApplication]activateIgnoringOtherApps:YES]; [theWindow orderFrontRegardless]; [theWindow makeKeyWindow]; [[NSApplication sharedApplication] activateIgnoringOtherApps:YES]; } Note the send-every-possible-message-to-make-it-do-what-it-should-be-doing-approach. This works, kind-of, the window is brought to the front on top of all other windows from all apps, BUT most of the time it isn't active, meaning it's title bar is greyed out. Clicking on the title bar won't make the window active either. Clicking INSIDE of the window will make it active!? This all didn't seem to be a problem in Leopard; just calling activateIgnoringOtherApps and making the window key seemed to work just fine. In Snow Leopard there is a new API designed to replace LSUIElement that is supposed to emulate its behaviour: http://developer.apple.com/mac/library/releasenotes/cocoa/appkit.html I've played around with that, but it's SL-only and I haven't been able to get LSUIElement being set. Any help would be greatly appreciated!

    Read the article

  • Cocoa/Objective-C - Child window with text input without main window becoming inactive

    - by Josh
    Hello All, I have a need to spawn a window that will hover just above my main window in a cocoa application. I want this main window to allow the user to enter some text in an input box. All is well until the text input box actually gains focus. The main window becomes "deactivated." This window is borderless and is a slightly custom shape -- its more like a hover card than anything else, I suppose. Basically, I'd like this thing to work almost exactly like Spotlight (Apple + Space) -- you can enter text, but this is such an an ancillary operation that in the context of the greater UX, you don't want the jarring effect of the main window graying out (becoming inactive). You'll notice when you have some application open and in-focus, spotlight will not cause the window of that application to become inactive. This problem arises because text input seems to REQUIRE that the child window become the key window (it will not let you place the cursor in the text input field). When it becomes key, the main window becomes inactive. So far I've tried: Subclassing NSWindow for my main application and overriding isKeyWindow such that it only loses key when the application is no longer the users focus (as opposed to the window). This had the unintended effect of colliding with key status of the child window and having very strange effects on the keyboard input (some keys are not captured, like delete) Creating a view instead of a window. Doesn't work because of this problem -- you cannot draw over a Webkit WebView these days. Anybody Cocoa/OSX wizards have any ideas? I've become a little obsessed with this one. An itch I can't scratch.

    Read the article

  • Layering Cocoa WebView - Drawing on top?

    - by Josh
    http://stackoverflow.com/questions/1618498/webview-in-core-animation-layer The only other thread I can find is the above which doesn't necessarily fit my needs. Is there a reliable way to simply draw a view on top of a webview? I've tried to layer a regular NSView on top of WebView, and it draws right at first, but any movement in the webview (scrolling the page etc) appears to invalidate the view and produces visual artifacts. I've tried: [[[NSApp mainWindow] contentView] addSubview:view positioned:NSWindowAbove relativeTo:webView]; No luck there, same problems -- z-ordering doesn't seem to work unless I'm missing something. Is this just a limitation of webviews? I also tried implementing the view above as a window, which worked much better (just controlled the location of the window programmatically). However, the desired behavior is for the user to enter some text into this window, but for it not to steal "focus" -- ie the main window goes inactive (the x - + go gray) when the user clicks on the text field in the new window. Any way to avoid that? I've tried subclassing NSWindow and overriding canBecomeKey (return YES) and canBecomeMain (return NO) but the window still steals focus. Josh

    Read the article

  • addSubview and autosizing

    - by neoneye
    How does one add views to a window, so that the views are resized to fit within the window frame? The problem I'm making a sheet window containing 2 views, where only one of them is visible at a time, so it's important that the views have the same size as the window. My problem is that either view0 fits correctly and view1 doesn't or the other way around. I can't figure out how to give them the same size as the window. Possible solution I could just make sure that both views have precisely the same size within Interface Builder, then it would work. However I'm looking for a way to do this programmatically. Screenshot of view0 Below you can see the autoresizing problem in the top and the right side, where the view is somehow clipped. Screenshot of view1 This view is resized correctly. Here is my code Can the views be resized before adding them to the window. Or is it better to do as I do now where the views are added one by one while changing the window frame. How do you do it? NSView* view0 = /* a view made with IB */; NSView* view1 = /* another view made with IB */; NSWindow* window = [self window]; NSRect window_frame = [window frame]; NSView* cv = [[[NSView alloc] initWithFrame:window_frame] autorelease]; [window setContentView:cv]; [cv setAutoresizesSubviews:YES]; // add subview so it fits within the contentview frame { NSView* v = view0; [v setHidden:YES]; [v setAutoresizesSubviews:NO]; [cv addSubview:v]; [v setFrameOrigin:NSZeroPoint]; [window setFrame:[v frame] display:NO]; [v setAutoresizesSubviews:YES]; } // add subview so it fits within the contentview frame { NSView* v = view1; [v setHidden:YES]; [v setAutoresizesSubviews:NO]; [cv addSubview:v]; [v setFrameOrigin:NSZeroPoint]; [window setFrame:[v frame] display:NO]; [v setAutoresizesSubviews:YES]; } // restore original window frame [window setFrame:window_frame display:YES]; [view0 setHidden:NO]; [view1 setHidden:YES];

    Read the article

  • Creating content of window programmatically

    - by Rui Pacheco
    Hi, I've a window that will have an unknown amount of text fields, determined by the content of a remote server. In high level terms, how should I go about this? Create a custom view or create an empty window with a backing NSWindowController and then add stuff to it when the window is opened? I've seen the examples on the O'Reilly Cocoa book and those effectively create a custom NSView. Is this the right way to do it, 8 year later?

    Read the article

1 2 3  | Next Page >