Re: Setting NSTableColumnIdentifier in Xcode 4.4.1?
On Aug 24, 2012, at 4:27 PM, Laurent Daudelin wrote: > Am I missing something? Where do you set the column identifier in Xcode 4.4? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Timeout after application:openFile: stalling applescript
My application implements the NSApplicationDelegate method -application:openFile: in its app delegate. There seems to be a problem new to OS 10.8 where after receiving the apple event to open a file, five seconds pass before some kind of internal timeout is hit, a response is sent to the apple event, and the calling app (e.g., applescript editor) proceeds. In detail, here's what I see. After application:openFile: returns YES, I can see that -[NSAppleEventManager suspendCurrentAppleEvent] is called: #0 0x7fff8f07b5ed in -[NSAppleEventManager *suspendCurrentAppleEvent*] () #1 0x7fff8f90458e in -[NSApplication(NSAppleEventHandling) _handleAEOpenDocumentsForURLs:] () #2 0x7fff8f903b55 in -[NSApplication(NSScripting) handleOpenScriptCommand:] () #3 0x7fff90770cac in __invoking___ () #4 0x7fff90770b47 in -[NSInvocation invoke] () #5 0x7fff90770d19 in -[NSInvocation invokeWithTarget:] () #6 0x7fff8f10121c in -[NSScriptCommand _sendToRemainingReceivers] () #7 0x7fff8f1014c6 in -[NSScriptCommand executeCommand] () #8 0x7fff8f11983a in -[NSScriptingAppleEventHandler handleCommandEvent:withReplyEvent:] () #9 0x7fff8f00635b in -[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:] () #10 0x7fff8f0061bd in _NSAppleEventManagerGenericHandler () #11 0x7fff93844f68 in aeDispatchAppleEvent () #12 0x7fff93844dc9 in dispatchEventAndSendReply () #13 0x7fff93844c89 in aeProcessAppleEvent () #14 0x7fff8c141e29 in AEProcessAppleEvent () #15 0x7fff8f6b22a6 in _DPSNextEvent () #16 0x7fff8f6b1862 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] () #17 0x7fff8f6a8c03 in -[NSApplication run] () #18 0x7fff8f64d656 in NSApplicationMain () #19 0x00011d7c in main (argc=3, argv=0x7fff5fbff7c0) at main.m:23 After five seconds, -[NSAppleEventManager resumeWithSuspensionID:] is called: #0 0x7fff8f07b6be in -[NSAppleEventManager *resumeWithSuspensionID*:] () #1 0x7fff8f90585f in __block_global_1 () #2 0x7fff9073a4b4 in * __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__* () #3 0x7fff90739fcd in __CFRunLoopDoTimer () #4 0x7fff9071f7b9 in __CFRunLoopRun () #5 0x7fff9071edd2 in CFRunLoopRunSpecific () #6 0x7fff8c137774 in RunCurrentEventLoopInMode () #7 0x7fff8c137512 in ReceiveNextEventCommon () #8 0x7fff8c1373a3 in BlockUntilNextEventMatchingListInMode () #9 0x7fff8f6b1fa3 in _DPSNextEvent () #10 0x7fff8f6b1862 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] () #11 0x7fff8f6a8c03 in -[NSApplication run] () #12 0x7fff8f64d656 in NSApplicationMain () #13 0x00011d7c in main (argc=3, argv=0x7fff5fbff7c0) at main.m:23 Evidently, some kind of timeout was reached since resumeWithSuspensionID: is called from a timer and it is always very close to 5 second between my application:openFile: method returning and resumeWithSuspensionID: being called. After this, things proceed normally: whatever applescript invoked "open file ..." continues at the next statement. There don't appear to be any errors--it just times out waiting for something. I turned on AEDebugSends and AEDebugReceives. Here's what I see up to the timeout: Aug 23 21:26:05 George-Nachmans-MacBook-Air.local iTerm[4819] : _aeMachPortCallback(), got a message, @ 0x0x7fff5fbfe1f0 size=972 info=0 (_aeMachPortCallback()/AEMach.cp #643) main Aug 23 21:26:05 George-Nachmans-MacBook-Air.local iTerm[4819] : AE2000 (4819: Received an event: --oo start of event oo-- aevt('aevt'\'odoc' transactionID=0 returnID=3711 sourcePSN=[0x0,6f06f "AppleScript Editor"] eventSource=3 sourceUID=501 sourceGID=20 sourceEUID=501 sourceEGID=20 sourcePID=3551 auditToken=[501,501,20,501,20,3551,15,3551]{ '':obj ('obj '{ 'form':enum('name'), 'want':type('file'), 'seld':utxt('utxt'(TEXT("Macintosh HD:Users:georgen:Library:Application Support:iTerm:version.txt"))), 'from':null() }), &'csig':magn(65536) }) --oo end of event oo-- (aeProcessIncomingEvent()/AEMach.cp #1445) main 2012-08-23 21:26:05.451 iTerm[4819:707] Command: NSCoreSuite.Open Direct Parameter: /Users/georgen/Library/Application Support/iTerm/version.txt Receivers: (null) Arguments: { "" = "/Users/georgen/Library/Application Support/iTerm/version.txt"; } Then, after the timeout I see this (which is logged because I also set NSScriptingDebugLogLevel to 1): 2012-08-23 21:26:36.347 iTerm[4819:707] Result: My openFile: method doesn't do anything besides return YES. Is there something else I need to do to make the framework happy? Thanks, George ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
NSComboBox with NSNumberFormatter DataSource works but not Content binding
Here's a little mystery that maybe someone can help me with… I have an NSComboBox for numbers (and hence with an NSNumberFormatter attached to its text field) for which I'd like to populate some items in the drop down list. I understand that I must present NSDecimalNumber objects for list content and I'd prefer to use bindings for this, so I create a simple NSArray of NSDecimalNumber values and provide this as the Content binding. I get a drop down list with no visible values. If I give up and use a DataSource, I can instantiate NSDecimalNumbers in the -comboBox:objectValueForItemAtIndex: method and everything works peachy. Now, I don't know what this means exactly, but I thought I'd implement a value transformer in the Content binding, just to take a look at the values flying by and maybe assert values of NSDecimalValue type. What I find is the transformer is provided with the _whole_ array to transform, rather than individual value elements as I'd expect. It's hard not to conclude that NSComboBox with an NSNumberFormatter attached is somehow broken for binding, but I'd certainly like to be put right on that score. In the meantime, I have a workaround in the way of a DataSource. But I'm sad. I like binding things. -- Luke ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Mac cursor hotspot is not at the tip of the cursor
Hi all! Just figured out that for some reason on Mac OS X default cursor (black with white border) has it's hotspot not on the tip of the white border, but inside - on the tip of the black arrow inside. Assuming this, using default cursors with small custom graphics elements is weird - you think do click, but actually you don't. Enlarging cursor in Universal Access makes issue even more weird - the cursor is enormously big, but still has hotspot on the tip of the black arrow inside the white border. Is there any way to make using default cursor as customer expects and make it's hotspot at the tip of the white border, not inside it, of the default cursor arrow? Thanks! ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
NSTextView frame issue inside NSTableView
I want to put a attributed string on a nstextview, and manually calculate the height of the textview and row -(CGFloat)tableView:(NSTableView *)tableView heightOfRow:(NSInteger)row inside -(NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row I update frame of TextView, textView.frame = CGRectMake(57.0f, 36.0f-height, 380.0f, height); height is the calculated result for NSTextView. everything is fine for the first time, but if I scroll, the TextView starts move down, it has been bugs me for a day, does anyone knows why? thanks in advance. -- jun1st.f...@gmail.com Sent with Sparrow (http://www.sparrowmailapp.com/?sig) ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
UINavigationBar, global right button logo for the entire application, how?
Hey!, I'm trying to set a logo image at the right side of the navigation bar for the entire application, so far I got this: http://pastie.org/private/pmwhfasyaskynw7xupinrw and I got this exception: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[_UIBarItemAppearance setRightBarButtonItem:]: unrecognized selector sent to instance 0x68a9c00' There's another way to set a global button for the entire application?. Thanks. -- Juan Felipe Alvarez Saldarriaga http://juan.im Twitter: @nebiros Google Talk: nebi...@gmail.com Skype: jfasaldarriaga ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Targeting actions/methods on selected object in NSObjectController
I'm not clear on the options for targeting actions on a selected object in bound UI. I have some list of objects (like a master list), out of which selection allows a single object to show details in UI below. So, this is a pretty standard Master-Detail set up. I have an NSObjectController managing the selected object and a lot of UI binds to properties of this of course in order to display and edit things. Now one of the properties of this selected object is another list (array) of things, so these area displayed in a table with little "+" and "-" buttons in the popular style. I need to get the "+" button to fire an action on the selected object managed by the NSObjectController. It would be perhaps regular to have an action defined on the class of these selectable objects such as: - (IBAction)addListItem:(id)sender However, I can't see how to target the object inside this NSObjectController in the normal way in xcode (4.4.1 btw). NSObjectController supports a small number of its own actions, and even if it were to somehow pass actions down to the contained object, there's no way I can see to define custom actions on most objects in xcode. Obviously, I could target some other higher-level controller (like a window controller, app controller etc.) that could then have an outlet for the NSObjectController in order to get at its selected object, but that seems like going the long way round and it would create some 'noise' in the form of an extra outlet and actions at that level. What does seem to work (and is the approach I'm taking now) is the Target binding on the "+" button, bound to the NSObjectController's selection. This works fine, except that I can't easily target action methods, because I can't see how to generate the button's "self" as the Argument binding easily (not without adding another unwanted outlet on a controller just to acquire the button object). So, I currently just target a zero argument method: - (void)addListItem So, in a nutshell, what I'm asking is whether there's a nice way to connect to an action method within an NSObjectController from my button action. Perhaps the Target binding _is_ the only way this is supposed to work directly in this sort of scenario? -- Luke ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Converting NSImage with multiple image representations (HiDPI+LowDPI) into grayscale NSImage
Hi, I have been running into a problem wherein I need to grayscale all the NSImageRep objects within a NSImage (i.e. say NSImage contains two representations for testimg.png and test...@2x.png). CGImageRef which has a one-to-one correspondence with one image representation. With CGImageRef, the conversion to grayscale is straight-forward. I can pick out NSImageRep objects of NSImage and then use [NSImageRep CGImageForProposedRect:context:hints:] method to extract CGImageRef. I can do grayscale conversion on each of these CGImageRefs, however I cannot put these back into a single NSImage. Is there a way to do this without converting to CGImageRef? How do we handle multiple representations when applying grayscale? Regards -Abhijit ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Getting local IP of Wi-Fi device
Hi tamas [[nshost currenthost] address] should either return an IPv4 or an IPv6 address (you probably saw an IPv6) Von unterwegs gesendet Am 12.09.2012 um 08:58 schrieb Tamas Nagy : > Hello List, > > I'm looking for a way to get the IP address of the Wi-Fi device. For some > reason, [NSHost currentHost]… gives me something like a MAC address, instead > of an IP on 10.8. > > Thanks, > > Tamas > ___ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/cocoa-dev/luckystrik3%40gmail.com > > This email sent to luckystr...@gmail.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Converting NSImage with multiple image representations (HiDPI+LowDPI) into grayscale NSImage
On Sep 10, 2012, at 12:31 AM, Abhijit Apte wrote: > I can pick out NSImageRep objects of NSImage and then use [NSImageRep > CGImageForProposedRect:context:hints:] method to extract CGImageRef. I can > do grayscale conversion on each of these CGImageRefs, however I cannot put > these back into a single NSImage. Why not? Use -[NSBitmapImageRep initWithCGImage:] and -[NSImage addRepresentation:]. --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSComboBox with NSNumberFormatter DataSource works but not Content binding
On Sep 4, 2012, at 23:12 , Luke Evans wrote: > I understand that I must present NSDecimalNumber objects for list content and > I'd prefer to use bindings for this, Why must you use NSDecimalNumber instead of NSNumber? > so I create a simple NSArray of NSDecimalNumber values and provide this as > the Content binding. I get a drop down list with no visible values. The "content" binding is documented to require a NSArrayController. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Targeting actions/methods on selected object in NSObjectController
On Sep 9, 2012, at 00:18 , Luke Evans wrote: > I have some list of objects (like a master list), out of which selection > allows a single object to show details in UI below. So, this is a pretty > standard Master-Detail set up. I have an NSObjectController managing the > selected object and a lot of UI binds to properties of this of course in > order to display and edit things. Based on your description, it seems that you should be using a NSArrayController rather than a NSObjectController. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Mac cursor hotspot is not at the tip of the cursor
On Sep 5, 2012, at 05:16 , Ernesto Monde wrote: > Is there any way to make using default cursor as customer expects and make > it's hotspot at the tip of the white border, not inside it, of the default > cursor arrow? Ever since the beginning of [Mac] time, the hotspot is at the tip of the black arrow -- the black arrow *is* the arrow. The white border around it is there just to make the cursor visible when it's over a dark background. If a dark background is general in your app, you could provide your own cursor image, and put the hotspot wherever you want, but whenever the cursor changes back to the standard arrow (e.g. outside of your windows) the hotspot is going to be the tip of the [black] arrow as it has always been. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: UINavigationBar, global right button logo for the entire application, how?
This is a traditional (irritating) message that could be better handled in Objective-C. You're sending a message to do something to an object that doesn't have that method implemented in it. OC likes to crash in that case. Check to make sure that you are sending setRightBarButtonItem to an object that actually has that method in it. On Sep 7, 2012, at 10:41 AM, nebi...@gmail.com wrote: > Hey!, > > I'm trying to set a logo image at the right side of the navigation bar for > the entire application, so far I got this: > http://pastie.org/private/pmwhfasyaskynw7xupinrw and I got this exception: > > Terminating app due to uncaught exception 'NSInvalidArgumentException', > reason: '-[_UIBarItemAppearance setRightBarButtonItem:]: unrecognized > selector sent to instance 0x68a9c00' > > There's another way to set a global button for the entire application?. > > Thanks. > > -- > Juan Felipe Alvarez Saldarriaga > http://juan.im > Twitter: @nebiros > Google Talk: nebi...@gmail.com > Skype: jfasaldarriaga > > ___ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/cocoa-dev/zav%40mac.com > > This email sent to z...@mac.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
maintaining alpha value for intersecting lines?
When I draw two lines using NSBezierPaths, both of which have an alpha value of let's say 0.5, the alpha value appears to be higher at the intersection (the color becomes more opaque). Is there a way to maintain the original alpha value for lines that intersect? - Koen. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: maintaining alpha value for intersecting lines?
Just to clarify, I set the color of the path as follows: [[NSColor colorWithCalibratedRed: 0.1 green: 0.1 blue: 0.1 alpha: 0.5] setStroke]; On Thu, Sep 13, 2012 at 8:40 AM, Koen van der Drift wrote: > When I draw two lines using NSBezierPaths, both of which have an alpha > value of let's say 0.5, the alpha value appears to be higher at the > intersection (the color becomes more opaque). Is there a way to > maintain the original alpha value for lines that intersect? > > - Koen. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: maintaining alpha value for intersecting lines?
It is the expected behavior, since the stacking of two partially transparent objects leads to a less transparent set. So I don't know what you want is possible. Are your lines straight ? If so, maybe you could try to draw one of them in two segments, to avoid the intersection (beware of the anti-aliasing). - Jean On 13 sept. 2012, at 14:40, Koen van der Drift wrote: > When I draw two lines using NSBezierPaths, both of which have an alpha > value of let's say 0.5, the alpha value appears to be higher at the > intersection (the color becomes more opaque). Is there a way to > maintain the original alpha value for lines that intersect? > > - Koen. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Setting NSTableColumnIdentifier in Xcode 4.4.1?
Same place as earlier. Second row input field in the properties inspector. Make sure the column is the active node. Erik Roaring Sky On 2012-08-24, at 2:31 PM, Gerd Knops wrote: > > On Aug 24, 2012, at 4:27 PM, Laurent Daudelin > wrote: > >> Am I missing something? Where do you set the column identifier in Xcode 4.4? > > ___ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/cocoa-dev/erik.stainsby%40roaringsky.ca > > This email sent to erik.stain...@roaringsky.ca ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: maintaining alpha value for intersecting lines?
It is higher. That's what happens when the lines intersect. The effect is additive. Unless you have a mode setting where the compositing replaces what's below it. The alpha of the top curve doesn't change at the intersection point. What you're doing is putting one alpha-ed pixel on top of another, and the alpha on the top one lets the one below it show through based on the alpha value of the top pixel. On Sep 13, 2012, at 8:43 AM, Koen van der Drift wrote: > Just to clarify, I set the color of the path as follows: > > [[NSColor colorWithCalibratedRed: 0.1 green: 0.1 blue: 0.1 alpha: > 0.5] setStroke]; > > > > On Thu, Sep 13, 2012 at 8:40 AM, Koen van der Drift > wrote: >> When I draw two lines using NSBezierPaths, both of which have an alpha >> value of let's say 0.5, the alpha value appears to be higher at the >> intersection (the color becomes more opaque). Is there a way to >> maintain the original alpha value for lines that intersect? >> >> - Koen. > ___ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/cocoa-dev/zav%40mac.com > > This email sent to z...@mac.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSSplitView crash upon restore from 10.8 Versions Browser
I was able to reproduce and fix this problem that went away a few weeks ago. The mystery factor was that the crash only occurs if user clicks on the old (right-screen side) version while in the Versions Browser, which causes its window to resize, before restoring. On 2012 Aug 20, at 14:14, Kevin Perry wrote: > Looks like the crash is happening while attempting to invoke > -respondsToSelector:. Very good, Kevin. Apparently, objc_msgSend_vtable5 implies -respondsToSelector: > Odds are that this is a message being sent to [self delegate], which looks > like a deallocated object. Indeed, that is what was happening. I was sending setDelegate:nil during -windowWillClose:, but the message was not being delivered because when I replaced RBSplitView with NSSplitView to make the project buildable in Xcode 4, I neglected to reconnect the outlet from the window controller to the new NSSplitView. It's connected now, and no more crashes. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: maintaining alpha value for intersecting lines?
I'm afraid it won't work. That's the principle of transparency: you can see what's below, tinted by the color of what's on top. What are you trying to do ? Maybe there's an other way around. On 13 sept. 2012, at 14:59, Koen van der Drift wrote: > That would be too bad. But maybe I can use one of the > NSCompositingOperation constants, I just read about that. > > https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/NSImage_Class/Reference/Reference.html#//apple_ref/c/tdef/NSCompositingOperation > > I'll try that later. > > - Koen. > > On Thu, Sep 13, 2012 at 8:51 AM, Jean Suisse wrote: >> It is the expected behavior, since the stacking of two partially transparent >> objects leads to a less transparent set. >> So I don't know what you want is possible. >> Are your lines straight ? If so, maybe you could try to draw one of them in >> two segments, to avoid the intersection (beware of the anti-aliasing). >> >> - Jean >> >> On 13 sept. 2012, at 14:40, Koen van der Drift wrote: >> >>> When I draw two lines using NSBezierPaths, both of which have an alpha >>> value of let's say 0.5, the alpha value appears to be higher at the >>> intersection (the color becomes more opaque). Is there a way to >>> maintain the original alpha value for lines that intersect? >>> >>> - Koen. >> Jean Suisse Institut de Chimie Moléculaire de l’Université de Bourgogne (ICMUB) — UMR 6302 U.F.R. Sciences et Techniques, Bâtiment Mirande Aile B, bureau 411 9, avenue Alain Savary — B.P. 47870 21078 DIJON CEDEX ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: maintaining alpha value for intersecting lines?
On Sep 13, 2012, at 7:40 AM, Koen van der Drift wrote: > When I draw two lines using NSBezierPaths, both of which have an alpha > value of let's say 0.5, the alpha value appears to be higher at the > intersection (the color becomes more opaque). Is there a way to > maintain the original alpha value for lines that intersect? Does this still happen with a single NSBezierPath containing both lines? Regards, Ken ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: maintaining alpha value for intersecting lines?
Are the lines the same color? Is it possible you can do your drawing in a layer, draw the Bezier paths *without* transparency (alpha = 1), and then apply alpha to the layer? --Andy On Sep 13, 2012, at 8:40 AM, Koen van der Drift wrote: > When I draw two lines using NSBezierPaths, both of which have an alpha > value of let's say 0.5, the alpha value appears to be higher at the > intersection (the color becomes more opaque). Is there a way to > maintain the original alpha value for lines that intersect? > > - Koen. > ___ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/cocoa-dev/aglee%40mac.com > > This email sent to ag...@mac.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: maintaining alpha value for intersecting lines?
On Sep 13, 2012, at 11:44, Ken Thomases wrote: > On Sep 13, 2012, at 7:40 AM, Koen van der Drift wrote: > >> When I draw two lines using NSBezierPaths, both of which have an alpha >> value of let's say 0.5, the alpha value appears to be higher at the >> intersection (the color becomes more opaque). Is there a way to >> maintain the original alpha value for lines that intersect? > > Does this still happen with a single NSBezierPath containing both lines? Is that possible, since they all have different begin and end points? - Koen. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: maintaining alpha value for intersecting lines?
On Thu, Sep 13, 2012 at 12:00 PM, Andy Lee wrote: > Are the lines the same color? Is it possible you can do your drawing in a > layer, draw the Bezier paths *without* transparency (alpha = 1), and then > apply alpha to the layer? > I am not usijng layers for this. Just drawing paths in my drawRect method. But I'll look into it, thanks. - Koen. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: maintaining alpha value for intersecting lines?
On 2012-09-13, at 9:02 AM, Koen van der Drift wrote: > On Sep 13, 2012, at 11:44, Ken Thomases wrote: > >> On Sep 13, 2012, at 7:40 AM, Koen van der Drift wrote: >> >>> When I draw two lines using NSBezierPaths, both of which have an alpha >>> value of let's say 0.5, the alpha value appears to be higher at the >>> intersection (the color becomes more opaque). Is there a way to >>> maintain the original alpha value for lines that intersect? >> >> Does this still happen with a single NSBezierPath containing both lines? > > Is that possible, since they all have different begin and end points? > > - Koen. Each stroke can have separate begin and end points from previous strokes. Look at -[NSBezierPath moveToPoint:] Erik > ___ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/cocoa-dev/erik.stainsby%40roaringsky.ca > > This email sent to erik.stain...@roaringsky.ca ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: maintaining alpha value for intersecting lines?
On Sep 13, 2012, at 12:02 PM, Koen van der Drift wrote: > On Sep 13, 2012, at 11:44, Ken Thomases wrote: >> Does this still happen with a single NSBezierPath containing both lines? > > Is that possible, since they all have different begin and end points? Yes. An NSBezierPath can contain multiple unconnected paths. --Andy ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: maintaining alpha value for intersecting lines?
On Thu, Sep 13, 2012 at 1:01 PM, Andy Lee wrote: > On Sep 13, 2012, at 12:02 PM, Koen van der Drift > wrote: >> On Sep 13, 2012, at 11:44, Ken Thomases wrote: >>> Does this still happen with a single NSBezierPath containing both lines? >> >> Is that possible, since they all have different begin and end points? > > Yes. An NSBezierPath can contain multiple unconnected paths.\ That is good to know, I'll look at it later today - Koen. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: maintaining alpha value for intersecting lines?
More specifically, CGContextBeginTransparencyLayer() and CGContextEndTransparencyLayer() will do what you need, in case you can't use a single bezier path. You set the global alpha to the transparency you want, start the transparency layer, draw *without the alpha*, end the transparency layer. Marcel typed into mail - CGContextSetAlpha( context , 0.5 ); CGContextBeginTransparencyLayer( context, nil ); [[NSColor colorWithCalibratedRed: 0.1 green: 0.1 blue: 0.1 alpha:1.0] setStroke]; [bezierPath1 stroke]; [bezierPath2 stroke]; CGContextEndTransparencyLayer( context ); typed into mail - On Sep 13, 2012, at 18:30 , Koen van der Drift wrote: > On Thu, Sep 13, 2012 at 12:00 PM, Andy Lee wrote: >> Are the lines the same color? Is it possible you can do your drawing in a >> layer, draw the Bezier paths *without* transparency (alpha = 1), and then >> apply alpha to the layer? >> > > I am not usijng layers for this. Just drawing paths in my drawRect > method. But I'll look into it, thanks. > > - Koen. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Mac cursor hotspot is not at the tip of the cursor
On Sep 5, 2012, at 5:16 AM, Ernesto Monde wrote: > Is there any way to make using default cursor as customer expects… Yes. Leave it alone. That's what the customer expects. Why should the arrow cursor behave any differently in your application versus every other application? -- Seth Willits ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Hints for supporting dragging a file onto the dock icon, then onto a row in menu presented at that point?
I'm pretty new to OS X development and just looking for hints about how to do something like this... I saw an app called Dragster that allows you to drag a file over the dock icon for the app, at which point a menu of rows opens up form the app icon, and you can continue to drag the file over a particular row. I'd like to emulate that notion of dragging a file over the dock icon, then over a row in a menu presented from the icon. So far I've played with: 1. Using the openFile: and openFiles: NSApplication delegates to let me handle dragging a file over the icon and handling that. 2. Modifying the dock menu to add items and separators to the dock menu (at least simple cases). But what I notice here is that this menu if presented on a two-fingered click of the doc icon, not presented when I drag the file over the dock icon. How do I get the or a menu to show when I drag the file onto the icon? Then, once I get a menu showing, how do I get to the point where I can drag the file onto a row in the menu? I'm perfectly fine with pointers for things and areas to look at relative to this... Thanks in advance! Chris ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Sandboxing not so bad
Sandboxing is not as restrictive than I though it would be. For example, the documentation for the entitlement: com.apple.security.files.user-selected.read-write says this entitlement provides: "Read/write access to files the user has selected using an Open or Save dialog" . I was reading more into that than I should have. If you use the Open dialog to access a file, then you can read and write to the file. You don't have to use the Save dialog to write to the file. And that file can be anywhere on the file system (except for system files I guess). And yes the app is really sandboxed. If no entitlements are enabled I can't do anything (except read and write to recent documents in the Open Recent menu). So with just that entitlement and a Printing Entitlement I can do just about everything I could previously do before Sandboxing. The only thing I can't do is write comments to the Finder GetInfo window -- because that uses Applescript. But I can live without that. So unless I'm missing something, sandboxing is a piece of cake. Thanks, Jim Merkel ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: maintaining alpha value for intersecting lines?
On Sep 13, 2012, at 1:01 PM, Andy Lee wrote: >> >> Is that possible, since they all have different begin and end points? > > Yes. An NSBezierPath can contain multiple unconnected paths. This did the trick, I created all lines within the same NSBezierPath, and when they overlap, the color remained the same. No need to set any blending or composition modes. Saved me also a lot of creating NSBezierPath instances and drawing them one at a time. - Koen. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Sandboxing not so bad
On 14/09/2012, at 5:45 AM, James Merkel wrote: > So unless I'm missing something, sandboxing is a piece of cake. Congratulations, your app uses the file system in a simple way, and in the way that was largely anticipated by the sandboxing design. It's when you have slightly unusual requirements that things get tricky. If you want to retain access to a file you opened across relaunches of your app, sandboxing will prevent that without special steps being taken. If you want to use the Save dialog to save a file WITHIN your sandbox, you can't. If you need access to files whose paths or URLs you create programmatically (e.g. you select a file.foo but it has a counterpart file.bar that you also need to access) you can't... These are the sorts of issues that have caused so much grief, not the simple ones you mention. --Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Sandboxing not so bad
Gentlemen, I'm not a moderator, but I'm _sick_ of this argument. Can we please not have it again? --Kyle Sluder On Thu, Sep 13, 2012, at 03:53 PM, Graham Cox wrote: > > On 14/09/2012, at 5:45 AM, James Merkel wrote: > > > So unless I'm missing something, sandboxing is a piece of cake. > > > Congratulations, your app uses the file system in a simple way, and in > the way that was largely anticipated by the sandboxing design. > > It's when you have slightly unusual requirements that things get tricky. > If you want to retain access to a file you opened across relaunches of > your app, sandboxing will prevent that without special steps being taken. > If you want to use the Save dialog to save a file WITHIN your sandbox, > you can't. If you need access to files whose paths or URLs you create > programmatically (e.g. you select a file.foo but it has a counterpart > file.bar that you also need to access) you can't... > > These are the sorts of issues that have caused so much grief, not the > simple ones you mention. > > --Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Another sandboxing snafu
Grrr... and here's exactly the sort of stupid thing that I was referring to a moment ago in another thread... I'm attempting to show an NSOpenPanel as a sheet, app is sandboxed. This has always worked perfectly fine: NSOpenPanel*op = [NSOpenPanel openPanel]; [op setAllowsMultipleSelection:NO]; [op setCanChooseDirectories:NO]; [op setAllowedFileTypes:[NSImage imageFileTypes]]; void (^completionHandler)(NSInteger result) = ^(NSInteger result) { if( result == NSFileHandlingPanelOKButton ) { // do stuff with URL from panel (omitted) } }; [op beginSheetModalForWindow:[self windowForSheet] completionHandler:completionHandler]; But now when this code runs, the following is logged: 14/09/12 9:02:18.578 AM WindowServer[108]: CGXSetWindowShape: Operation on a window 0xf87 requiring rights kCGSWindowRightOwner by caller Artboard 14/09/12 9:02:18.578 AM Artboard[47282]: _NXPlaceWindow: error setting window shape (1001) 14/09/12 9:02:18.583 AM com.apple.security.pboxd[47286]: : the delegate was sent -splitView:resizeSubviewsWithOldSize: and left the subview frames in an inconsistent state: 14/09/12 9:02:18.584 AM com.apple.security.pboxd[47286]: Split view bounds: {{0, 0}, {0, 0}} 14/09/12 9:02:18.584 AM com.apple.security.pboxd[47286]: Subview frame: {{0, 0}, {-316, 0}} 14/09/12 9:02:18.584 AM com.apple.security.pboxd[47286]: Subview frame: {{-315, 0}, {315, 0}} 14/09/12 9:02:18.585 AM com.apple.security.pboxd[47286]: The subview frames are not in the same order as the subviews array. NSSplitView requires that these orders be kept consistent, otherwise behavior is undefined. Anyone got this simple use of NSOpenPanel to work with sandboxing? --Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Sandboxing not so bad
On 14/09/2012, at 9:14 AM, Kyle Sluder wrote: > I'm _sick_ of this argument. I'm sick of it too. When sandboxing has finally been implemented in a way that is non-buggy, covers all the edge cases and is reasonably straightforward for developers to use, perhaps it will go away. --Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: maintaining alpha value for intersecting lines?
On 14/09/2012, at 7:56 AM, Koen van der Drift wrote: > > On Sep 13, 2012, at 1:01 PM, Andy Lee wrote: > >>> >>> Is that possible, since they all have different begin and end points? >> >> Yes. An NSBezierPath can contain multiple unconnected paths. > > This did the trick, I created all lines within the same NSBezierPath, and > when they overlap, the color remained the same. No need to set any blending > or composition modes. Saved me also a lot of creating NSBezierPath instances > and drawing them one at a time. Combining paths into a single NSBezierPath means those paths are treated as a single object for a drawing operation, and intersections are rendered accordingly. However, this behaviour doesn't come at no cost - the code has to find those intersections and deal with them by ensuring that the same pixels are not rendered twice. While usually faster than looping over separate paths, this intersection finding can potentially slows things down a lot. --Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: maintaining alpha value for intersecting lines?
On Sep 13, 2012, at 7:24 PM, Graham Cox wrote: > > On 14/09/2012, at 7:56 AM, Koen van der Drift > wrote: > >> >> On Sep 13, 2012, at 1:01 PM, Andy Lee wrote: >> Is that possible, since they all have different begin and end points? >>> >>> Yes. An NSBezierPath can contain multiple unconnected paths. >> >> This did the trick, I created all lines within the same NSBezierPath, and >> when they overlap, the color remained the same. No need to set any blending >> or composition modes. Saved me also a lot of creating NSBezierPath instances >> and drawing them one at a time. > > > Combining paths into a single NSBezierPath means those paths are treated as a > single object for a drawing operation, and intersections are rendered > accordingly. However, this behaviour doesn't come at no cost - the code has > to find those intersections and deal with them by ensuring that the same > pixels are not rendered twice. While usually faster than looping over > separate paths, this intersection finding can potentially slows things down a > lot. > > --Graham > Hi Graham As always, I appreciate your input, especially on questions regarding drawing stuff. In my case so far I have not yet seen any slow down, since only a few lines *may* intersect. Luckily it doesn't look like a spiderweb. - Koen. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
kABHomeLabel … and companions
Hello folks, So the AddressBook framework's xxxLabel keys render out as strings encoded like so: _$!!$_, _$!!$_, _$!!$_ Is there framework method I am meant to use with the property keys kABHomeLabel, kABWorkLabel, etc, to render a legible text outcome ? Or am I meant to create my own lookup reference and to translate them as I see fit ? Erik Stainsby erik.stain...@roaringsky.ca ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Hints for supporting dragging a file onto the dock icon, then onto a row in menu presented at that point?
On Thu, Sep 13, 2012 at 2:40 PM, Chris Markle wrote: > I'm pretty new to OS X development and just looking for hints about > how to do something like this... I saw an app called Dragster that > allows you to drag a file over the dock icon for the app, at which > point a menu of rows opens up form the app icon, and you can continue > to drag the file over a particular row. I'd like to emulate that > notion of dragging a file over the dock icon, then over a row in a > menu presented from the icon. I've never done this, but I think a good place to start would be with the Dock Time Programming Guide: https://developer.apple.com/library/mac/#documentation/Carbon/Conceptual/customizing_docktile/intro/dockintro.html#//apple_ref/doc/uid/TP3986-CH1-TP1 Maybe create a custom view for your dock tile then track the mouse and/or drag events over it? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Timeout after application:openFile: stalling applescript
On 2012 Aug 23, at 21:34, George Nachman wrote: > My application implements the NSApplicationDelegate method > -application:openFile: in its app delegate. There seems to be a problem new > to OS 10.8 where after receiving the apple event to open a file, five > seconds pass before some kind of internal timeout is hit, a response is > sent to the apple event, and the calling app (e.g., applescript editor) > proceeds. My application also implements the NSApplicationDelegate method -application:openFile: in its app delegate. To test, in 10.8.x, I just "told" it the following line in AppleScript Editor… open POSIX file "/path/to/document" It worked fine, several times. Document opened and AppleScript Editor became responsive again immediately. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: kABHomeLabel … and companions
On 2012 Sep 13, at 19:45, Erik Stainsby wrote: > So the AddressBook framework's xxxLabel keys render out as strings encoded > like so: _$!!$_, _$!!$_, _$!!$_ Is there framework > method I am meant to use with the property keys kABHomeLabel, kABWorkLabel, > etc, to render a legible text outcome Maybe you're looking for -[ABRecord valueForProperty:]. Note that ABAddressBook methods typically return ABPerson objects, and ABPerson inherits from ABRecord. If that doesn't explain it, post some code. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: kABHomeLabel … and companions
I understand that ABAddressBook methods are concerned with ABPerson and ABGroup entities, subclasses of ABRecord. However, the ABMultiValue collections are less intuitive. Among these are stored the (potentially) multiple instances of addresses, phone numbers and email addresses. For each instance of user supplied data, a multiValue object can store - in properties keyed with kABXxxx keys - arbitrary labels: home, work, iPhone, mobile, etc. The documentation leaves much to be desired, but in particular, I cannot glean how to retrieve a user-supplied string from a given multiValue object. Some code: Given some address, stored in an ABMultiValue object, such that: - (void) unwrapMV:(ABMultiValue*)mv atIndex:(int)index { NSString * _uuid = [mv identifierAtIndex:index]; NSString * _label = [mv labelForIdentifier:[mv identifierAtIndex:index]]; NSDictionary * _dict = [mv valueAtIndex:index]; // am I the identified primary entry? BOOL_primary= ([mv primaryIdentifier] == self.uuid)? YES: NO; NSLog( @"%@", _label) ; } produces _$!!$_, or one of the other variants of the actual value of the key, not the value it refers to. Clearly I am failing to understand where these strings are being stored. Erik Stainsby erik.stain...@roaringsky.ca On 2012-09-13, at 9:04 PM, Jerry Krinock wrote: > > On 2012 Sep 13, at 19:45, Erik Stainsby wrote: > >> So the AddressBook framework's xxxLabel keys render out as strings encoded >> like so: _$!!$_, _$!!$_, _$!!$_ Is there framework >> method I am meant to use with the property keys kABHomeLabel, kABWorkLabel, >> etc, to render a legible text outcome > > Maybe you're looking for -[ABRecord valueForProperty:]. Note that > ABAddressBook methods typically return ABPerson objects, and ABPerson > inherits from ABRecord. > > If that doesn't explain it, post some code. > > > ___ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/cocoa-dev/erik.stainsby%40roaringsky.ca > > This email sent to erik.stain...@roaringsky.ca ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Arghh bindings
On Sep 11, 2012, at 4:28 , Charles Srstka wrote: > On Sep 10, 2012, at 9:23 PM, Quincey Morris > wrote: > >> It doesn't need "all the extra scaffolding". KVC will peer quite happily >> into your instance variables by default. What you don't get for free, in >> that case, is KVO compliance for the property. The purpose of providing >> explicit accessors is therefore twofold: >> >> 1. It avoids letting KVC introspect your ivars, which is a horrible hack. >> >> 2. It gives you automatic KVO compliance. > > With that said, writing these accessors *is* rather mechanical and > repetitive, and it would be nice if @synthesize could create the appropriate > accessors in this case. Or maybe synthesizing accessors should not baked into language, but rather part of (user-extensible) libraries. Just a thought, Marcel ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Hints for supporting dragging a file onto the dock icon, then onto a row in menu presented at that point?
On Sep 13, 2012, at 12:40 PM, Chris Markle wrote: > I saw an app called Dragster that > allows you to drag a file over the dock icon for the app, at which > point a menu of rows opens up form the app icon, and you can continue > to drag the file over a particular row. I think they are using some dark-gray magic to do that kind of thing; see below. It’s not at all straightforward. This isn’t something that sounds reasonable for a newbie programming task. > 1. Using the openFile: and openFiles: NSApplication delegates to let > me handle dragging a file over the icon and handling that. That’s not going to give you control until the user releases the mouse. > 2. Modifying the dock menu to add items and separators to the dock > menu (at least simple cases). But what I notice here is that this menu > if presented on a two-fingered click of the doc icon, not presented > when I drag the file over the dock icon. Right. Dragster definitely isn’t using a normal dock menu — this must be a custom window that they open and do mouse-tracking in. I don’t know how they detect that the mouse is over the dock tile, or even how they figure out the on-screen coordinates of the tile. There isn’t any straightforward way to do either. (NSDockTile only lets you customize the appearance of the tile; it doesn’t support any special event handling.) My suspicion is that they are using a private API that lets the app run a real live NSView in the dock tile. With that it would be pretty easy to build that sort of UI. I know that this API has existed for a long time, but I don’t know the details (and talking about private APIs on this list is not allowed.) —Jens ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com