Re: Problem with capturing active state of the application

2009-06-17 Thread Andrew Farmer
On 17 Jun 2009, at 22:49, Srinivasa Prabhu wrote: In our application we want to capture a selected area similar to Apple's Cmd+Shift+4 i.e during selection capture, the active state of another application has to be captured. ... Is there any workaround to capture the active state of the app

Problem with capturing active state of the application

2009-06-17 Thread Srinivasa Prabhu
Hi All, In our application we want to capture a selected area similar to Apple's Cmd+Shift+4 i.e during selection capture, the active state of another application has to be captured. This is what we are doing currently. When the user enters the selection capture mode, we hide the applica

Re: Group CGAffineTransform Animations?

2009-06-17 Thread WT
Hi David, On Jun 18, 2009, at 12:42 AM, David Duncan wrote: Your solution works because you've scaled the coordinate system, so the translation needs to be scaled too (to get the change specified by the translation). Yes, that was the point I was trying to make on earlier posts, though i

Re: Add same object/key to NSMapTable

2009-06-17 Thread Michael Ash
On Wed, Jun 17, 2009 at 10:10 PM, Jim Correia wrote: > On Wed, Jun 17, 2009 at 9:51 PM, Bill Bumgarner wrote: > >> You can't assume that the container didn't make a copy or do something else. >> >> If you need the object, you should hold a retain. > > In general, I agree. However, the following co

Re: Add same object/key to NSMapTable

2009-06-17 Thread Michael Ash
On Wed, Jun 17, 2009 at 9:51 PM, Bill Bumgarner wrote: > On Jun 17, 2009, at 8:48 PM, Nathan Vander Wilt wrote: >>> >>> In the meantime, the explicit case you present is always going to be >>> fraught with peril, because after you release o, you have relinquished >>> all rights to it.  It's now a w

Re: How to fill rectangle under vertical scroller?

2009-06-17 Thread Andrew Farmer
On 16 Jun 2009, at 21:40, Sumin Kim wrote: That's not part of the scroller. Assuming you're working with NSTableView, this is the cornerView, which you can set up separately. Yes, you are right. I am working with table. Of course I tried to use cornerView. But as far as I understood wi

Re: Add same object/key to NSMapTable

2009-06-17 Thread Jim Correia
On Wed, Jun 17, 2009 at 9:51 PM, Bill Bumgarner wrote: > You can't assume that the container didn't make a copy or do something else. > > If you need the object, you should hold a retain. In general, I agree. However, the following code is also problematic: [o release]; [testTable setObject:[te

Re: Add same object/key to NSMapTable

2009-06-17 Thread Kyle Sluder
On Wed, Jun 17, 2009 at 6:48 PM, Nathan Vander Wilt wrote: > Isn't it acceptable practice to let a container object I hold to maintain > its objects on my behalf? Not explicitly, no. Take -[NSWindowController delegate], for example. Because delegates are a weak reference, the contract is explici

Re: Add same object/key to NSMapTable

2009-06-17 Thread Bill Bumgarner
On Jun 17, 2009, at 8:48 PM, Nathan Vander Wilt wrote: In the meantime, the explicit case you present is always going to be fraught with peril, because after you release o, you have relinquished all rights to it. It's now a weak reference. Isn't it acceptable practice to let a container obj

Re: Add same object/key to NSMapTable

2009-06-17 Thread Nathan Vander Wilt
On Jun 17, 2009, at 6:44 PM, Kyle Sluder wrote: On Wed, Jun 17, 2009 at 6:33 PM, Nathan Vander Wilt wrote: I could find no documentation to the effect that re-assigning an object is not allowed, so can I assume this is indeed unintentional? If so, I've got this test case in project form an

Re: Add same object/key to NSMapTable

2009-06-17 Thread Kyle Sluder
On Wed, Jun 17, 2009 at 6:33 PM, Nathan Vander Wilt wrote: > I could find no documentation to the effect that re-assigning an object is > not allowed, so can I assume this is indeed unintentional? If so, I've got > this test case in project form and would be happy to file a bug. Please do file a b

Re: Notification/callback of successful CGEventPost?

2009-06-17 Thread Peter N Lewis
On 17/06/2009, at 9:22 , Dave DeLong wrote: I have this mostly working, but it's not a satisfactory solution. My problem is with posting the CGEvents for a command-v operation. I've found that if I do everything inline (snapshot, replace, paste, restore snapshot), then the restore operatio

Add same object/key to NSMapTable

2009-06-17 Thread Nathan Vander Wilt
The following (simplified test case) code will crash with NSZombieEnabled: NSMapTable* testTable = [NSMapTable mapTableWithStrongToStrongObjects]; NSString* o = [@"test_object" mutableCopy]; NSString* k = @"test_key"; [testTable setObject:o forKey:k]; [o release]; [testTable setObject:o forKey:

Re: Safari-4-like Pulldown List

2009-06-17 Thread Dong Feng
Hi Sean, It is a superb answer to my initial question that ease my decision to the next step work. Thank you for the answer and for sharing your project. A great work! Dong. 2009/6/16 Sean Murphy : > On Jun 14, 2009, at 5:01 AM, Dong Feng wrote: > > I want to implement a pulldown list like w

Re: UTI not identified correctly for some users.

2009-06-17 Thread Sean McBride
On 6/17/09 7:07 PM, Mitchell Livingston said: >None of the apps I found have it set up in the Info.plist. From users >with the problem I've discovered they have it set up as >"com.bittorrent.torrent". Perhaps I should just change it to that, but >that's not future-proof enough incase another progr

Re: UTI not identified correctly for some users.

2009-06-17 Thread Mitchell Livingston
On Jun 16, 2009, at 6:20 PM, Sean McBride wrote: On 6/15/09 12:36 AM, Mitchell Livingston said: Thanks for that. I am dealing with .torrent extensions. I have the UTI defined as "org.bittorrent.torrent". Both apps are using the same file format, so there shouldn't be a problem with a sing

Enter Key Behavior in NSTableView

2009-06-17 Thread Chris Tracewell
I have a subclass of NSTableView which I have implemented keyDown to pick up delete and enter key presses. When the TV is bound to an array controller it works perfectly, I can detect keyDowns for the above mentioned and as a bonus when the user presses "Enter" or "Return" the field editor

Re: UTI not identified correctly for some users.

2009-06-17 Thread Sean McBride
On 6/15/09 12:36 AM, Mitchell Livingston said: >Thanks for that. I am dealing with .torrent extensions. I have the UTI >defined as "org.bittorrent.torrent". Both apps are using the same file >format, so there shouldn't be a problem with a single UTI. OK, you're in a not-so-bad situation then. Th

Re: Group CGAffineTransform Animations?

2009-06-17 Thread David Duncan
On Jun 17, 2009, at 2:11 PM, WT wrote: You're absolutely correct in general, but - if I'm not mistaken - CGAffineTransform rotations and scalings already do their thing with respect to the center of the view they're being applied to. In fact, I tested that before writing my solution to the

Re: Group CGAffineTransform Animations?

2009-06-17 Thread WT
On Jun 17, 2009, at 11:11 PM, WT wrote: You're absolutely correct in general, but - if I'm not mistaken - CGAffineTransform rotations and scalings already do their thing with respect to the center of the view they're being applied to. In fact, I tested that before writing my solution to the

Re: Group CGAffineTransform Animations?

2009-06-17 Thread Andy Lee
On Wednesday, June 17, 2009, at 06:07PM, "WT" wrote: >On Jun 17, 2009, at 11:53 PM, Erik Buck wrote: >> Just in case: I didn't mean to imply that even third graders should >> understand matrix math. > >They do in Star Trek The Next Generation. Or maybe it was calculus. And yet in the latest Sta

Re: Group CGAffineTransform Animations?

2009-06-17 Thread WT
On Jun 17, 2009, at 11:53 PM, Erik Buck wrote: My third grader was taught about associative and commutative math operations. Some matrix operations are associative and some are commutative. That's why the order of operations matters. Just in case: I didn't mean to imply that even third gr

Re: Group CGAffineTransform Animations?

2009-06-17 Thread Erik Buck
> My third grader was taught about associative and commutative math > operations.  Some matrix operations are associative and some are > commutative.  That's why the order of operations matters.   Just in case: I didn't mean to imply that even third graders should understand matrix math.  It

Re: Group CGAffineTransform Animations?

2009-06-17 Thread WT
On Jun 17, 2009, at 11:28 PM, David Duncan wrote: On Jun 17, 2009, at 1:58 PM, WT wrote: my understanding was that the OP wanted to do all three operations concurrently. Of course, if he wants simply to move, then scale, and then rotate, there are easier ways to accomplish that than to us

Re: Group CGAffineTransform Animations?

2009-06-17 Thread David Duncan
On Jun 17, 2009, at 1:58 PM, WT wrote: my understanding was that the OP wanted to do all three operations concurrently. Of course, if he wants simply to move, then scale, and then rotate, there are easier ways to accomplish that than to use transforms. You can set the center & transform

Re: How to fill rectangle under vertical scroller?

2009-06-17 Thread Scott Andrew
Have you looked at a couple of frameworks that already do this? The two i can think of fare. BWToolkit and HMBlkAppKit. Source is available for both. Scott On Jun 16, 2009, at 9:40 PM, Sumin Kim wrote: That's not part of the scroller. Assuming you're working with NSTableView, this

Re: Group CGAffineTransform Animations?

2009-06-17 Thread WT
On Jun 17, 2009, at 10:40 PM, Erik Buck wrote: Only a little bit of math is neccessary to use affine transforms. A lot of math is needed for general 3D programming, but let's ignore that for now. My third grader was tought about associative and communitive math operstions. Some matrix o

Re: Group CGAffineTransform Animations?

2009-06-17 Thread WT
On Jun 17, 2009, at 10:50 PM, David Duncan wrote: On Jun 17, 2009, at 7:21 AM, Chunk 1978 wrote: premiss: a red cube, 50 width x 50 height, located at {0,0}. i want to scale the cute 2 times it's width and height, move it to the center of the screen, and rotate it 90º In general you wil

MDSchemaCopyAllAttributes() returning nil

2009-06-17 Thread Dave DeLong
Hey everyone, I'm working on a project that works a lot with Spotlight, and we're trying to get a list of all the attributes that Spotlight knows about. We found a really nice function called MDSchemaCopyAllAttributes that returns a CFArrayRef of CFStringRefs, each one corresponding to a

Re: Group CGAffineTransform Animations?

2009-06-17 Thread David Duncan
On Jun 17, 2009, at 7:21 AM, Chunk 1978 wrote: premiss: a red cube, 50 width x 50 height, located at {0,0}. i want to scale the cute 2 times it's width and height, move it to the center of the screen, and rotate it 90º In general you will have a better understanding of what is going on i

Re: Group CGAffineTransform Animations?

2009-06-17 Thread Erik Buck
Only a little bit of math is neccessary to use affine transforms.  A lot of math is needed for general 3D programming, but let's ignore that for now.   My third grader was tought about associative and communitive math operstions.  Some matrix operations are associative and some are communitive. 

Re: Group CGAffineTransform Animations?

2009-06-17 Thread WT
On Jun 17, 2009, at 9:10 PM, Chunk 1978 wrote: ... perhaps there's a way to set the transforming object's origin to it's center some how? i could work with that... The problem is a more subtle one than simply a question of what order in which to perform the transforms. What's happening is t

Re: repeatable random numbers in an object

2009-06-17 Thread Michael Ash
On Wed, Jun 17, 2009 at 1:05 PM, Kyle Sluder wrote: > On Wed, Jun 17, 2009 at 9:54 AM, Kirk Kerekes wrote: >> > > Not to knock on Don Knuth, but I wouldn't recommend using that code in > your app.  There's a perfectly good RNG facility in t

Re: Group CGAffineTransform Animations?

2009-06-17 Thread Chunk 1978
... perhaps there's a way to set the transforming object's origin to it's center some how? i could work with that... On Wed, Jun 17, 2009 at 2:37 PM, Chunk 1978 wrote: > still having issues.  i've changed the order of transforms: > > -=-=-=- >                CGAffineTransform transform = > CGAffi

Re: Group CGAffineTransform Animations?

2009-06-17 Thread Chunk 1978
still having issues. i've changed the order of transforms: -=-=-=- CGAffineTransform transform = CGAffineTransformMakeTranslation(centerPoint.x, centerPoint.y); transform = CGAffineTransformScale(transform, 2, 2); transform = CGAffineTransformRotate

Re: CFAttributedStringGetMutableString returning null value

2009-06-17 Thread Ali Ozer
This function has not been implemented for the pure-CoreFoundation case. This is mentioned in the header comments: > (Note: This function is not yet implemented and will return NULL except for toll-free bridged instances.) But it is not in the docs; should be. As the comment implies, you c

Re: repeatable random numbers in an object

2009-06-17 Thread Kyle Sluder
On Wed, Jun 17, 2009 at 9:54 AM, Kirk Kerekes wrote: > Not to knock on Don Knuth, but I wouldn't recommend using that code in your app. There's a perfectly good RNG facility in the system as Mr. George Warner pointed out, and Knuth's code

Re: repeatable random numbers in an object

2009-06-17 Thread Kirk Kerekes
___ 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/

Re: Arranging NSStrings in a Table column

2009-06-17 Thread Kyle Sluder
Use three columns. --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 Sub

Re: Desktop client for web application

2009-06-17 Thread Kyle Sluder
2009/6/17 Robert Černý : > I'm looking for a recommendation - where to start. I'm in need of > developing a desktop client for web application which (unfortunately) > doesn't have an API. My original idea was to mimics browser - parse > responses and POST commands. Is it the right way to do it or i

Re: get ref to instance from IB

2009-06-17 Thread Kyle Sluder
On Wed, Jun 17, 2009 at 5:44 AM, Paul M wrote: > The UIController class is my own class which connects to all my UI elements. > I added 2 IBOutlets to this class, then wired these to the 2 instances of my > DataSource class, so now I have references to these instances, which is just > what I wanted

Re: Group CGAffineTransform Animations?

2009-06-17 Thread Kyle Sluder
On Wed, Jun 17, 2009 at 9:14 AM, Gordon Apple wrote: >    IMHO, matrix operations are one of the most confusing and cumbersome > aspects of Cocoa.  Every time I use them, I end up trying most combinations > until I get the desired result.  C++ doesn't have this problem.  You can > simply write the

Re: Group CGAffineTransform Animations?

2009-06-17 Thread Gordon Apple
IMHO, matrix operations are one of the most confusing and cumbersome aspects of Cocoa. Every time I use them, I end up trying most combinations until I get the desired result. C++ doesn't have this problem. You can simply write the matrix equations and be done with it. I love Objective C, bu

Re: advice on background process

2009-06-17 Thread Jerry Krinock
On 2009 Jun 17, at 05:58, Rick C. wrote: the launchd task can tell me if there was a change but it seems there's no way to find out what that change was right? Yes. it seems i could use this to launch my app but then if i have no way to screen what the changes might be then i would have t

re: repeatable random numbers in an object

2009-06-17 Thread Mr. George Warner
On Wed, 17 Jun 2009 22:33:50 +0800, Roland King wrote: > I need to generate repeatable sequences of random numbers for a game. > For each level I give it the seed and want the level to unfold the > same way it did before. I can guarantee that the calls to any random > function will be in exactly

Re: Group CGAffineTransform Animations?

2009-06-17 Thread WT
On Jun 17, 2009, at 4:37 PM, Graham Cox wrote: It's fair to say that transforms can be a bit unintuitive - you expect them to perform the operations in the order you set. In fact, the reverse order is what it will actually do. (The explanation for this lies in the maths, but it sounds like

Re: Group CGAffineTransform Animations?

2009-06-17 Thread Graham Cox
On 18/06/2009, at 12:37 AM, Graham Cox wrote: On 18/06/2009, at 12:21 AM, Chunk 1978 wrote: premiss: a red cube, 50 width x 50 height, located at {0,0}. i want to scale the cute 2 times it's width and height, move it to the center of the screen, and rotate it 90º Incidentally there'

Re: [iPhone] (SOLVED) Strange behavior with modal view controllers

2009-06-17 Thread WT
Hi Michael, thanks for replying to my message. I'm not 100% certain, but I believe this delegate method is new in iPhone OS 3.0 (couldn't find it in the 2.2.1 docs). The project you put together also specifies the iPhone 3.0 SDK. I don't believe it is kosher to speak of these things on the

Re: repeatable random numbers in an object

2009-06-17 Thread Roland King
Not a horrible idea, but the 'levels' could be pretty open-ended if you're good at the game (eg think the numbers were choosing what piece is next in tetris, if you are the kind of person who can play level 1 for 3 hours you need a lot of numbers) so I'd prefer to generate them from a seed

Re: Group CGAffineTransform Animations?

2009-06-17 Thread Graham Cox
On 18/06/2009, at 12:21 AM, Chunk 1978 wrote: premiss: a red cube, 50 width x 50 height, located at {0,0}. i want to scale the cute 2 times it's width and height, move it to the center of the screen, and rotate it 90º -=-=-=- [UIView beginAnimations:nil context:NULL]; [UIView

repeatable random numbers in an object

2009-06-17 Thread Roland King
I need to generate repeatable sequences of random numbers for a game. For each level I give it the seed and want the level to unfold the same way it did before. I can guarantee that the calls to any random function will be in exactly the same order, so provided I get the same sequence out o

Re: [iPhone] Strange behavior with modal view controllers

2009-06-17 Thread Michael Babin
On Jun 17, 2009, at 5:43 AM, WT wrote: Is there any known reason whatsoever why presentModalViewController would do absolutely nothing? Possibly, depending on the meaning of "known". In any case, let's investigate further using the sample project you put together (referenced in a follow-u

Re: Group CGAffineTransform Animations?

2009-06-17 Thread Chunk 1978
alright... so i've been "playing" with this for a while now, and it's quite baffling... with grouping CAAffineTransform, i can't seem to understand the matrix math, and therefore have no real control over the transforming object, namely the translation point. premiss: a red cube, 50 width x 50 he

Re: Arranging NSStrings in a Table column

2009-06-17 Thread WT
Use 3 labels or text-fields, align them in your table view cell using Interface Builder, set the appropriate justification (left, right, or center), and then use a couple of lines of code to set their text values with the actual strings you have. Wagner On Jun 17, 2009, at 3:13 PM, Arun wr

Arranging NSStrings in a Table column

2009-06-17 Thread Arun
Hi All, I have 3 NSStrings How can i arrange mutiple strings with proper allignment in a table column as below. Any ideas? | | | | ---

Re: advice on background process

2009-06-17 Thread Rick C.
hello again, i've had some time to work on this and just to follow up with a couple things. first the launchd task can tell me if there was a change but it seems there's no way to find out what that change was right? it seems i could use this to launch my app but then if i have no way to scre

[iPhone] (follow-up) Strange behavior with modal view controllers

2009-06-17 Thread WT
Hello again, I've since created a small project that shows exactly the problem I described. It's a 32 Kb download, found here: http://www.restlessbrain.com/ModalVCTrouble.zip For this small project, I stripped off all animations and any irrelevant code, so it's the smallest project I can c

Re: get ref to instance from IB

2009-06-17 Thread Paul M
On 17/06/2009, at 12:36 PM, Andy Lee wrote: On Tuesday, June 16, 2009, at 08:10PM, "Paul M" wrote: Thanks for all the good information here. It's helping a lot. My data is largely static, if it does change it all changes, so if I save references to all my wrappers, I can just dump the lot and

Re: I want my app to crash!

2009-06-17 Thread M Pulis
Thanks, Andy. Excellent point. Seems to me I remember reading that... now! After always checking for nil allocation and error codes on various systems (my style since '78) and reinforced by MacOS toolbox procedural programming from '83, it is hard to write what looks like trusting code.

Re: I want my app to crash!

2009-06-17 Thread Andy Lee
On Jun 17, 2009, at 6:29 AM, M Pulis wrote: Most of us see the alloc init pattern when learning from example code for a quick feature demo. For purposes of brevity, example code is never meant to demonstrate error handling, much like I don't expect to see MyClass in shipping source. The re

Re: Group CGAffineTransform Animations?

2009-06-17 Thread Chunk 1978
i see how you write looks cleaner, is easier to follow. but i now have first hand experience with the matrix multiplications with unexpected results as your code has different results than mine. CGAffineTransformTranslate lands in a different space. interesting :) On Wed, Jun 17, 2009 at 6:26 AM

[iPhone] Strange behavior with modal view controllers

2009-06-17 Thread WT
Hi there, I'll ask the question first, then I'll explain why I'm asking it. Is there any known reason whatsoever why presentModalViewController would do absolutely nothing? In an iPhone game app I'm working on, I have a tab-bar with 5 items, 2 of which are managed by the SettingsViewContro

Re: I want my app to crash!

2009-06-17 Thread M Pulis
On Jun 17, 2009, at 1:33 AM, Andreas Grosam wrote: On Jun 17, 2009, at 3:27 AM, Jim Correia wrote: On Jun 16, 2009, at 6:58 PM, Andreas Grosam wrote: On Jun 16, 2009, at 11:33 PM, Jim Correia wrote: Another example is chained message sends where an inner message send may return nil. M

Re: Group CGAffineTransform Animations?

2009-06-17 Thread Jean-Daniel Dupas
Concatenation is just a matrix multiplication: http://developer.apple.com/documentation/graphicsimaging/Conceptual/drawingwithquartz2d/dq_affine/dq_affine.html#/ /apple_ref/doc/uid/TP30001066-CH204-CJBECIAD So yes, you can do that. It's just a matter of taste, but I would write it like that i

Re: Group CGAffineTransform Animations?

2009-06-17 Thread Graham Cox
On 17/06/2009, at 7:37 PM, Chunk 1978 wrote: it seems to work find, but is this the most ideal way of doing this? Yes, it's the correct way to do it. If you read the article that Jean linked on Wikipedia, you would see what's going on. A transform is just a matrix, and a concatenation is

Re: I want my app to crash!

2009-06-17 Thread Andreas Grosam
Uhps - sent this to the wrong list. I apologize. Please ignore. On Jun 17, 2009, at 10:33 AM, Andreas Grosam wrote: ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact th

Re: Group CGAffineTransform Animations?

2009-06-17 Thread Chunk 1978
CGAffineTransformConcat() only allow for 2 arguments. so in the case where i have 3 transforms, i had to concatenate the first 2 to make "Group1", and then concatenate that with the final transform: -=-=-=- //Animation Block [UIView beginAnimations:nil context:NULL]; [UIVi

Re: Group CGAffineTransform Animations?

2009-06-17 Thread Chunk 1978
thanks! :) On Wed, Jun 17, 2009 at 5:05 AM, Jean-Daniel Dupas wrote: > > Le 17 juin 09 à 10:53, Chunk 1978 a écrit : > >> is have this animation block with both Enlarge and Rotate, but only >> one work properly (the last one listed).  what is the proper way to >> group the two transforms together

Re: Group CGAffineTransform Animations?

2009-06-17 Thread Jean-Daniel Dupas
Le 17 juin 09 à 10:53, Chunk 1978 a écrit : is have this animation block with both Enlarge and Rotate, but only one work properly (the last one listed). what is the proper way to group the two transforms together: -=-=-=- //Animation Block [UIView beginAnimations:nil context:N

Desktop client for web application

2009-06-17 Thread Robert Černý
Hello guys, I'm looking for a recommendation - where to start. I'm in need of developing a desktop client for web application which (unfortunately) doesn't have an API. My original idea was to mimics browser - parse responses and POST commands. Is it the right way to do it or is there a better meth

Group CGAffineTransform Animations?

2009-06-17 Thread Chunk 1978
is have this animation block with both Enlarge and Rotate, but only one work properly (the last one listed). what is the proper way to group the two transforms together: -=-=-=- //Animation Block [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:1.0];

Re: I want my app to crash!

2009-06-17 Thread Andreas Grosam
On Jun 17, 2009, at 3:27 AM, Jim Correia wrote: On Jun 16, 2009, at 6:58 PM, Andreas Grosam wrote: On Jun 16, 2009, at 11:33 PM, Jim Correia wrote: Another example is chained message sends where an inner message send may return nil. MyClass *obj = [[MyClass alloc] init]; You can do thi