Re: NSDictionary key types

2011-01-06 Thread Murat Konar
On Jan 6, 2011, at 12:43 PM, Quincey Morris wrote: > The semantics of keys also requires them to be immutable (well, maybe that's > the semantics of 'isEqual:') The immutability requirement stems from needing to guarantee that keys in a dictionary are unique. If a key was mutable, it could be c

Re: Close System Preferences programmatically

2011-01-04 Thread Murat Konar
Leaving aside for the moment the wisdom of all this... Preference panes run in the same process as the System Preferences application. That means they can directly call methods of the objects that make up System Preferences. A simple way to get System Preferences to "Show All" is to simply call

Re: Close System Preferences programmatically

2011-01-04 Thread Murat Konar
Since you can't reload bundles, you might need to quit System Preferences as part of a preference pane's self-updating scheme. But it's probably better to just ask the user to do it. _murat On Jan 4, 2011, at 1:08 PM, Nick Zitzmann wrote: > > On Jan 4, 2011, at 1:56 PM, eveningnick eveningnic

Re: iOS: Monospaced fonts aren't?

2010-12-10 Thread Murat Konar
Maybe CourierNewPS-BoldMT is not a monospaced font? _murat On Dec 10, 2010, at 11:39 AM, Phillip Mills wrote: > I've been having one of those "I must be doing something stupid" days. The > code I'm trying to write needs to pad one string with spaces so that certain > characters line up visual

Re: NSString/NSFont/Dingbats and the SnowFlake symbol

2010-11-24 Thread Murat Konar
Beware the user that has removed all fonts that contain a snowflake... Maybe it would be better to "roll your own". _murat On Nov 24, 2010, at 10:14 AM, Dave DeLong wrote: > You can also do: > > NSString * snowflake = @"\u2744"; > > Cheers, > > Dave > > On Nov 24, 2010, at 10:11 AM, Stephen

Re: Moderator - Re: iPad 4.2 (deploy to 3.2.2) error

2010-11-10 Thread Murat Konar
Simple. If it's not been released yet, don't talk about it. _murat On Nov 10, 2010, at 11:00 AM, Laurent Daudelin wrote: [snip] > ...how do you know when you're talking about something that it's under NDA or > not? For example, I have seen already a few walkthrough of and information > about

Re: confused about floats

2010-10-08 Thread Murat Konar
A stripped down version of your code works as expected here. - (IBAction) test:(id) sender { //set coordinates to x,y -> 0,0 to start float x = 0; float y = 0; while (YES) { NSLog(@"x = %f, y = %f", x, y); x = x+100; //if coordinates are too

Re: Help to understand how do events work

2010-10-07 Thread Murat Konar
On Oct 6, 2010, at 10:00 PM, eveningnick eveningnick wrote: > Do keyDowns come only to those applications which have a keyWindow > displayed on a screen? You'll only get keydowns if 1) Your app is the active application 2) Your window is key 3) Your view is in the window's responder chain. 4

Re: Set the Cursor Position

2010-08-19 Thread Murat Konar
CGDisplayMoveCursorToPoint(CGDirectDisplayID display, CGPoint point); But heed the other's hints that, except for special classes of software (like a VNC app), software that warps the pointer's location independent of the mouse is much un-loved on the Mac. _murat On Aug 19, 2010, at 6:13 P

Re: stringByReplacingCharactersInRange leading to bus error

2010-08-18 Thread Murat Konar
ug 18, 2010, at 11:56 AM, Dave Carrigan wrote: On Aug 18, 2010, at 11:52 AM, Murat Konar wrote: On Aug 18, 2010, at 11:06 AM, John C. Randolph wrote: -stringByReplacingCharactersInString: creates and returns a new string, which is autoreleased. Always? I recall running into a problem tha

Re: stringByReplacingCharactersInRange leading to bus error

2010-08-18 Thread Murat Konar
On Aug 18, 2010, at 11:06 AM, John C. Randolph wrote: -stringByReplacingCharactersInString: creates and returns a new string, which is autoreleased. Always? I recall running into a problem that was caused by - stringByReplacingCharactersInString: (or a method like it) simply returning sel

Re: Compiler bug?

2010-07-13 Thread Murat Konar
nd be assured that the code I'm working on is not production/shipping code, just something for a UI prototype. _murat On Jul 13, 2010, at 3:04 PM, Stephen J. Butler wrote: On Tue, Jul 13, 2010 at 3:44 PM, Murat Konar wrote: WTF? For those interested, you can download my test project

Compiler bug?

2010-07-13 Thread Murat Konar
On Mac OS X 10.5.8, Xcode 3.1.3, I ran into some very strange behavior today trying to get at the extended attributes of files. In summary, for particular NSDictionary object, the behavior of -objectForKey: is different, depending on what other code runs. I have distilled the weirdness in

Re: Strange NSView/NSWindow behavior

2010-05-04 Thread Murat Konar
On May 4, 2010, at 11:32 AM, vincent habchi wrote: Keeping it short: look up -[NSView mouseDownCanMoveWindow]. Override it to return NO if you never want a click in the view to drag the window. But, if I am not mistaken, when the event is caught and handled, it should not propagate furthe

Re: Windows following the menubar in Cocoa

2010-05-03 Thread Murat Konar
On May 3, 2010, at 3:31 PM, Eric Gorr wrote: Is there a way to configure a Cocoa window so it will follow the menubar to another display? Is it even a good idea? Seems like there's more to be done than just move a window (like maybe not moving it if it won't fit, resizing it etc). I'm

Re: Matching the style of a HUD?

2010-04-30 Thread Murat Konar
On Apr 30, 2010, at 12:02 PM, Izak van Langevelde wrote: Maybe I'm overlooking something trivial, but an NSPanel with HUD style is still an NSPanel, and not a window: I cannot seem to get the minimize and maximize buttons in the title bar? Are you really making a HUD or do you just want you

Re: NSNumberFormatter not working for me ?

2010-04-14 Thread Murat Konar
I think Greg's point is that NSNumberFormatter is designed to format numbers which represent quantities. A phone number not a quantity, it's just a string of characters which happen to be digits. _murat On Apr 14, 2010, at 6:38 PM, Bill Hernandez wrote: On Apr 14, 2010, at 5:25 PM, Greg Gu

Re: Question about -awakeAfterusingCoder:

2010-04-14 Thread Murat Konar
I've always avoided using setters in init methods for exactly the problem you've run into. A setter's behavior can depend on an object's state, and by definition, the object's state is not really properly setup *during* init. _murat On Apr 14, 2010, at 6:23 PM, Graham Cox wrote: Hi all,

Re: NSNumberFormatter not working for me ?

2010-04-14 Thread Murat Konar
Bill Hernandez wrote: On Apr 13, 2010, at 8:09 PM, Murat Konar wrote: If you don't explicitly set a formatter behavior, you are probably getting the newest behavior "NSNumberFormatterBehavior10_4", and - setFormat: does require the older "NSNumberFormatterBehavior10_0&quo

Re: NSNumberFormatter not working for me ?

2010-04-13 Thread Murat Konar
ehavior on the instance itself. _murat On Apr 13, 2010, at 4:37 PM, Bill Hernandez wrote: On Apr 13, 2010, at 5:50 PM, Murat Konar wrote: For one thing, the docs say that -setFormat: is for use with formatters using NSNumberFormatterBehavior10_0 behavior. Have you set the formatters behavior?

Re: NSNumberFormatter not working for me ?

2010-04-13 Thread Murat Konar
For one thing, the docs say that -setFormat: is for use with formatters using NSNumberFormatterBehavior10_0 behavior. Have you set the formatters behavior? _murat On Apr 13, 2010, at 2:15 PM, Bill Hernandez wrote: I am calling a method that I pass a phone number string "1234567890" and sh

Re: Screen size in Dual monitor mode

2010-03-23 Thread Murat Konar
Shawn's right. Your screen area (made up of one or more screens) is likely to be non-rectangular, so the notion of a "whole screen size" is meaningless. There is no "whole screen", just a bunch of screens at arbitrary locations. _murat On Mar 23, 2010, at 8:07 AM, Shawn Erickson wrote: O

Re: Lock a file in cocoa

2010-03-19 Thread Murat Konar
This seems like a case where it might be good to know why you need to prevent a file from being trashed. There is probably a better way to accomplish what you need. _murat On Mar 19, 2010, at 11:36 AM, Charles Srstka wrote: On Mar 19, 2010, at 11:04 AM, Jens Alfke wrote: On Mar 19, 2010,

Re: Creating layered TIFF files

2010-03-02 Thread Murat Konar
Last time I looked into this (a couple of years ago), an external library was all I came up with. _murat On Mar 2, 2010, at 4:52 PM, Graham Cox wrote: I'm looking for hints, code or anything at all that will let me write a layered TIFF file from Cocoa. There are a few mentions in the arch

Re: NSForegroundColorAttributeName without AppKit

2010-03-01 Thread Murat Konar
On Mar 1, 2010, at 7:53 PM, Graham Cox wrote: On 02/03/2010, at 2:42 PM, Murat Konar wrote: Unfortunately it seems that using the @"NSColor" key as part of an NSAttributedString also requires AppKit. Well, that's because NSColor (the class) is part of AppKit. You can

Re: NSForegroundColorAttributeName without AppKit

2010-03-01 Thread Murat Konar
On Mar 1, 2010, at 7:27 PM, BareFeet wrote: Unfortunately it seems that using the @"NSColor" key as part of an NSAttributedString also requires AppKit. Well, that's because NSColor (the class) is part of AppKit. _murat ___ Cocoa-dev mailing list

Interface Builder plugin for NSWindow subclass?

2010-03-01 Thread Murat Konar
Is it possible to create an Interface Builder plugin for NSWindow (or NSPanel) subclasses? In NSWindow's docs it says "Although the NSWindow class inherits the NSCoding protocol from NSResponder, the class does not support coding. [...] Any attempt to archive or unarchive an NSWindow object

Re: How to detect if mouse on border of view

2010-02-19 Thread Murat Konar
Read up on NSView's addCursorRect:cursor: method. _murat On Feb 19, 2010, at 1:36 PM, Mazen M. Abdel-Rahman wrote: Thanks everyone for your help on this. I wanted to know if the mouse was on the border area prior to the mouse down event to determine if the mouse icon should change as the

Re: Perform additional action when window receives any mouse- or keyDown

2010-02-16 Thread Murat Konar
Uh, if I understand what the op wants to do correctly, overriding - [NSWindow mouseDown:] isn't going to do it. If the user clicks inside a view that overrides -mouseDown: (and friends -rightMouseDown: and -otherMouseDown:), there's no guarantee that your window's override will get called.

Re: Global in NSApplication

2010-01-26 Thread Murat Konar
Read up on categories. Then make the instance of your Debug class a static variable in your category implementation file, and use a method you added to NSApplication via your category to return it. _murat On Jan 26, 2010, at 6:05 PM, Ba

Re: rightMouseDown not working as documented?

2010-01-22 Thread Murat Konar
The descriptions for mouseDown: et. al. (in NSResponder's docs) all say "The default implementation simply passes this message to the next responder." NSControl documents the special behavior of its implementation of mouseDown:. NSView has no mention of any special behavior with regard to

Re: View Handling

2010-01-22 Thread Murat Konar
On Jan 22, 2010, at 3:23 PM, David Duncan wrote: On Jan 22, 2010, at 1:57 PM, David Blanton wrote: So my question. "What is the 'proper' means of handling this situation?" Rearrange the views to be siblings instead of parent-child in Interface Builder? Further more, use an NSTabView wi

rightMouseDown not working as documented?

2010-01-22 Thread Murat Konar
I've run into a surprising behavior today in Leopard 10.5.8 (haven't had the opportunity to test it on Snow Leopard yet). I have one view of class "RedView" nested inside another view "OrangeView". Both views are subclasses of NSView. This is the inner view's implementation of rightMouseDo