Re: Another best practice question: storing hotkey assignments

2014-01-04 Thread Ken Thomases
On Jan 4, 2014, at 3:58 PM, Alex Hall wrote: > //store a keystroke > NSUInteger key=[event keyCode]+[event modifierFlags]; This isn't safe. The documented device-independent modifier flags are all in the high 16 bits of a 32-bit value, but there are other flags in the other bits. At the very

Re: Another best practice question: storing hotkey assignments

2014-01-04 Thread Alex Hall
On Jan 4, 2014, at 2:14 PM, Steve Mills wrote: > On Jan 4, 2014, at 10:13:46, Alex Hall wrote: > >> Yes, I can do it, but it seems like there must be a more efficient way than >> or-ing every combination of those five masks with the modifier flags each >> keypress contains. I can't be the fi

Re: NSHTMLTextDocumentType returns wrong font names

2014-01-04 Thread Jens Alfke
On Jan 4, 2014, at 3:03 AM, Leonardo wrote: > I'm trying to export the content of my NSTextView to an HTML page. > I get the HTML code using > > NSDictionary *attributes = [NSDictionary > dictionaryWithObjectsAndKeys:NSHTMLTextDocumentType, > NSDocumentTypeDocumentAttribute, nil]; > NSData

Re: Another best practice question: storing hotkey assignments

2014-01-04 Thread Jerry Krinock
On 2014 Jan 04, at 11:14, Steve Mills wrote: > There ya go, 2 shorts make UInt32. Yes, except unless you’re doing this for fun, I wouldn’t get down to the bit level because this code, which is somewhat tedious (conversions between Carbon and Cocoa key codes come to mind), has already been wri

Auto Layout with NSSplitView, NSScrollView

2014-01-04 Thread thatsanicehatyouhave
Hi, I have a couple of questions about using auto layout (AL) with NSSplitView and NSScrollView. I have watched the (excellent) WWDC videos from 2012, but am having problems. I'm trying to implement an NSSplitView (not a custom view that's similar to NSSplitView) and want to retain the behavio

Re: Another best practice question: storing hotkey assignments

2014-01-04 Thread Steve Mills
On Jan 4, 2014, at 10:13:46, Alex Hall wrote: > As I build the map and the rest of the game engine, I'll need to detect and > match up keystrokes. I want the user to be able to define these if they want > to, plus I know there has to be a better way to store them than hard-coded in > a bunch o

Another best practice question: storing hotkey assignments

2014-01-04 Thread Alex Hall
Hello list, I'm happy to say my audio game is now working. The game itself is not written yet, but the audio menu is doing well - I can navigate it with the arrow keys and the proper selector is called when I press enter. Thanks again for all your help thus far. As I build the map and the rest

NSHTMLTextDocumentType returns wrong font names

2014-01-04 Thread Leonardo
I'm trying to export the content of my NSTextView to an HTML page. I get the HTML code using NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys:NSHTMLTextDocumentType, NSDocumentTypeDocumentAttribute, nil]; NSData *htmlData = [textView dataFromRange:editedRange