I have some submenu inserted as Window item submenu of Main Menu
I have an instance of my object (let's assume its class name is MenuController) inherited from NSObject and supports 2 from NSMenuDelegate methods:
– numberOfItemsInMenu:
– menu:updateItem:atIndex:shouldCancel:
This instance added as Blue-Object into NIB for awaking at run...
Hi,
Do events (i.e. -keyDown: and -keyUp:) follow the same responder chain as nil-targeted actions?
Thanks.
...
Hi,
I am having some issues binding an NSMenuItem's "value" binding to a BOOL.
I simplified the problem to this:
1) The menu item must call the action method that changes the value of the BOOL otherwise it doesn't work (i.e. if an NSButton calls a method that changes the value of the BOOL then the menu item won't update)
2) Even if ...
I want to do some drawing of NSAttributedStrings in fixed-width boxes, but am having trouble calculating the right height they'll take up when drawn. So far, I've tried:
Calling - (NSSize) size, but the results are useless (for this purpose), as they'll give whatever width the string desires.
Calling - (void)drawWithRect:(NSRect)rect o...
I'm working with an NSTextView and one of the requirements I have is that a tab character, '\t', shall have the same width as four spaces.
So the text-content would look like this:
AAAA
AAAA - 1 tab
AAAA - 4 spaces
And this is how I accomplish this:
// done when NSTextView first loaded and when
// delegate's textDidBeginEdit...
AppKit allows Python programs on a Mac to use ObjectiveC classes. I am not very familiar with ObjectiveC, but I want to access the NSSound class using AppKit in order to create an audio player.
My player should perform some action, such as loading the next item from the playlist, when the current audio finishes playing. There is a metho...
I have an NSSegmentedControl with the textured rounded style, and with the selection mode set to 'any'. The problem is that it is treating it like select none. When I switch the style to capsule, it works correctly. I am using this in a toolbar, although I have tested this in a view (on two different computers) as well and it behaves ...
Hi,
I have an NSTextField that I hide when the user presses a button. I hide the text field using [textField setHidden:YES]; The problem is that is the user is typing in the text field (i.e. the text field is first responder) and the user presses the return key (which is the key equivalent for the button that hides the text field) the u...
Hi,
I have an NSView in which the user can draw circles. These circles are stored as an array of NSBezierPaths, and in drawRect:, I loop through the array and call -stroke on each of the paths. How do I add a button to zoom in and out the NSView? Just change the bounds of the view?
Thanks.
...
Is there a way to have my app's window receive keyboard and/or mouse events (i.e. user clicking on window's buttons) while still retaining focus to another, unrelated app?
I've tried configuring my window at different levels, including [myWindow setLevel:NSPopUpMenuWindowLevel] to no avail.
...
Basically I want to create the effect of that provided in the system's menu bar. A user presses on one of the menu headings, and as he moves across the different headings, the menus open up automatically.
The snag is that if I open a pop-up menu for a button, the user has to click again to dismiss it. The entire runloop is on hold as I ...
I'm currently testing a new version of an app of mine on OSX 10.5
An user reported some weird crashes during use of the application, sadly not reproducible by me. At first sight it seems to happen randomly, once he had the crash while opening an NSOpenPanel and once during focusing an NSTextField and once during NSView switch in a parent...
Hello,
I'm building an application that uses a NSStatusItem and run in the background. The problem I'm running into is entering text into a NSTextField.
I've got a menu item in my NSStatusItem which:
[NSApp activateIgnoringOtherApps:YES]
[prefPanel makeKeyAndOrderFront:nil]
It shows up fine, but when I try to enter text into the NST...
Hi,
What are some suggested "paths" for getting better at drawing in code in Cocoa? I think at this point, that's my biggest weakness. Is drawing in code something general, or Cocoa-specific?
Thanks!
- Jason
...
I have a CGPath and I want to draw it once to a NSView. Seems relatively simple but I haven't found a way in AppKit (non iphone).
...
Assuming button1 is an NSPopUpButton
Assuming menu attached to button1 is displayed and being tracked.
[[button1 cell] dismissPopUp] --- dismissPopUp is not recognized.
Why is the dismissPopUp method not recognized?
Thanks
...
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...
Hi,
I'm slightly used as to what the purpose of CALayer's existence is. Why not just put the properties in a UIView?
Thanks.
...
I have a view which contains a few subviews:
mainView
subViewA
subViewB
SubViewC
mainView is an NSView constructed from a nib and is controlled with an NSViewController subclass. The subviews are standard views such as NSTextField and NSImageView and are configured to be non-editable. I want mainView to receive rightMouseD...
Is there any way to prevent the NSTokenField to select everything when pressing the ENTER key or when making to the first responder maybe using the TAB key?
...