nswindow

lock the position of an nswindow

hey there, is it posible to lock the position of an nswindow? I'm not asking for setIgnoresMouseEvents. I need to prevent the user from moving the window, but he should still be able to use the nstoolbar. thx in advance --molter ...

How do I convert Cocoa co-ords from top left == origin to bottom left == origin

I use CGWindowListCopyWindowInfo to get a list of all windows. It gives me the co-ordinates of each window based upon the origin being the top-left of the screen. If I use NSWindow's setFrame method, the co-ordinates on based upon the origin being the bottom-left of the screen. What's a clean, reliable way to convert from one to the ot...

How would you make a button display a window when clicked?

How would you make a button display a window in the same Nib File when it is clicked? Sorry If This Is Vague. ...

nswindowcontroller + program execution

Hi Guys I am trying to use nswindows controller to handle user inputs during the program execution. I am able to get the user input in a nstextfield but when i am clicking on the ok or cancel button, their respective IBAction methods are getting executed and the control is not getting returned to the previous execution place that should...

Cocoa: I've got my user's input - Now what?

In a nutshell what my program does is: it executes and takes user input periodically using nswindow (which is controlled by my NSWindowController object) and continues execution. here is my myController.mm which is calling and showing the window to take user input: EncryptPasswordDlgController encPassController = [[EncryptPasswordDlgC...

How to detect if NSDrawer will open off screen.

I am working on an app whose main window has an NSDrawer. It is crucial that the drawer will always open on the right edge, and that is how I have coded it to work. What I would like to know is if there is a way to detect if the drawer will open "off the screen"... Is there a way that I can detect this? If so, how? And additionally how c...

NSTableView responding to first click in a panel

I have noticed in the Interface Builder if I want to click on or drag from the Library panel, I only have to click on it once, even if the Library panel does not have the current focus. I am trying to build a panel that behaves similarly. Is there any simple way to let the NSTableView accept the click, even if the window does not have ...

get size of nswindow

Is there any way I get get the size of an NSWindow (in pixels) and display it? So when the person resizes the window the text will change and display the new size. ...

resizing an NSPanel to fit a dynamic NSMatrix and a button

I have an NSMatrix that is filled dynamically with some form items. Now, I can conveniently call [theMatrix sizeToCells] and then pass it into the panel to be displayed. Now, I want the NSPanel object which contains this NSMatrix to resize to wrap nicely around it. The NSPanel also has a button at the bottom which should be under the ...

Hide and Show HUD Window - Cocoa?

Hey all, I have a HUD window that has some labels on it, and I want this to show when the user presses a button. I know this is simple, but I can't get it to show again unless I restart my program. Sincerely, Kevin ...

How to get OS X to set initial location of NSWindow

How do I get OS X to place NSWindows in a reasonable default tiled-like location? Like when I open TextEdit and create 10 documents, I see all the windows as having the same size, but somebody is smart enough to place them offset from each other a bit. I'm sure that the app isn't doing this itself in code. (I need a code-based, not NI...

How to show a NSPanel as a sheet

I'm trying to show a NSPanel as a sheet. I'm naively doing something along those lines: SheetController *sheetController = [[[SheetController alloc] initWithWindowNibName:@"Sheet"] autorelease]; [[NSApplication sharedApplication] beginSheet:sheetController.window mo...

setOpaque:YES vs setBackgroundColor:[NSColor clearColor]

I'm going through a tutorial on drawing a custom [shaped] window with cocoa by subclassing NSWindow. The tutorial states that in initializer developer should do the following: [self setOpaque:NO]; [self setBackgroundColor:[NSColor clearColor]]; So i'm wondering what is the differnce between these two messages and why are they needed ...

Dimming NSWindow and layer NSView on top

Is there any way I could dim my NSWindow (basically putting a black transparent layer over top of it that you cannot click through) and then layer a custom NSView on top? ...

How to create a transparent window with non-rectangular buttons?

I am looking to make a custom window which would look something like this (never mind the quick photoshop): The main problem I have is not to make the window transparent (although I guess any info is welcome!), but that I want to be able to click only on the visible part of the buttons. For example, if I click just outside the top lef...

Why do I have to call showWindow on my NSWindowController twice on 10.5?

I've got a subclass of an NSWindowController that I'm using to load a window from a nib and show it on the screen. Below is the code that is called when I want to show the window. On 10.6 when showCustomWindow is called the window is displayed, but on 10.5 this method has to be called twice to get the window to display. -(IBAction)sho...

Fade in/Fade out for MAAttachedWindow

I'm using Matt Gemmell's MAAttachedWindow (http://mattgemmell.com/source) with an NSStatusItem to display a custom view in the menu bar. I'm confused as to how to get it to fade in and fade out. Normally I'd do something like this: [window makeKeyAndOrderFront:self]; [[window animator] setAlphaValue:1.0]; and to fade out: [[window an...

set custom length and width NSWindow

For my application I want to set a custom length and width for my NSWindow from within the application itself. I have everything set up (the NSTextfields) however I'm stumped with how I should do it. ...

makeKeyAndOrderFront only does the latter.

I am trying to open one window from another using makeKeyAndOrderFront. The new window appears, but does not receive focus. The code for the main window is: #import "SecondWindowController.h" @implementation FirstWindowController -(IBAction)showSecondWindow:(id)sender { if (!secondWindowController) secondWindowController = [[Sec...

Graying out an NSWindow's content

I have an NSWindow with 2 NSViews (an NSSplitView and a custom NSView). Accessing the data to populate these views can take some time. During this period, I'd like to gray out the content of these views. My first approach was to have a black third NSView that covered the other 2 and achieve the graying out effect by changing its alpha ...