Re: Window Resize with Animator Proxy: Window Contents Jump Around

2009-07-16 Thread Marc Liyanage



On 13.07.2009, at 15:59, I. Savant wrote:

 My guess: I think because you're removing (with or without  
animation) the bottom field / label, you're changing the autosizing  
behavior of the content view's contents while it's being moved around.




On 14.07.2009, at 04:37, Peter N Lewis wrote:

One thing that may trip you up is auto resizing.  Consider  
disabling it or making sure it is behaving properly.



To check this, I made an extremely simplified version that only has an  
empty window with the disclosure button and nothing else. I switched  
off the window's content view's "autoresize subviews" option and  
enabled its CA layer backing option:


http://www.entropy.ch/git/calayer-resize-test.git

Even in this setup, the windows's contents (which consist only of the  
disclosure button) jump up and down during the animation. It seems  
enabling CA layer backing is really not an option.


I tried the flipped content view, that didn’t help either.


Its ridiculously painful isn't it?


Indeed... Thanks for the MGViewAnimation hint, that looks promising  
and I’ll try using that instead...






___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Window Resize with Animator Proxy: Window Contents Jump Around

2009-07-13 Thread Marc Liyanage


I am trying to resize a window with an animation using the  
NSAnimatablePropertyContainer animator proxy mechanism. The views have  
the "Wants CA Layer" option set in IB.


I use this code:

NSRect frame = window.frame;
frame.size.height += delta;
frame.origin.y -= delta;
[[window animator] setFrame:frame display:YES];

The problem is that during the animation, the window contens jump down  
briefly when the window grows, and up when it shrinks. It does not do  
this when I do not reset the origin by commenting out this line:


//  frame.origin.y -= delta;

But then the window grows upward which is not what I want.

I made a screen video here:

http://www.youtube.com/watch?v=NARKujk2jrg


It also works if I don’t enable the CA layer backing in IB, but I need  
that because I am going to fade a subview at the same time as I resize  
the window. Without CA layers I can only hide and show the subview  
with a hard transition, but I want to fade it.


Is there something I should do differently or is this a known issue?


___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Using non-id sender in IBAction methods

2009-06-08 Thread Marc Liyanage


On 08.06.2009, at 03:09, Bryan Henry wrote:



As someone already said, if your action method is specific enough to  
the type of sender object


I should have been clearer about that. Yes, I am only talking about  
action methods that are pretty specific and that will not get  
connected to other types of senders.



On 08.06.2009, at 03:34, Andy Lee wrote:

I never thought of trying this before, but it seems that having a  
more narrowly defined sender also limits the kind of controls IB  
lets you connect *from*, at least in the Cocoa IB and presumably in  
the iPhone IB as well.



Wow, this is neat, I never noticed that before because I always used  
"id" in the past... It does work the same in Cocoa Touch.


That this functionality exists actually suggests to me that using a  
more specific sender type is legitimate.





___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Using non-id sender in IBAction methods

2009-06-07 Thread Marc Liyanage


With the new dot notation I sometimes use explicit types in my  
IBAction methods:


- (IBAction)doSomething:(UIButton *)button ...

instead of

- (IBAction)doSomething:(id)sender ...

so I don't have to downcast "sender" to be able to use the dot notation.

Do others do this too? Is this discouraged for some reason?



___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: dot notation doesn’t work as expected f or some library classes

2009-05-25 Thread Marc Liyanage


Thanks Gwynne and Mike, that clears it up. I didn’t think about the  
missing -string method. When I remove the getter from my custom class  
it behaves the same and that was what I wanted to see.


On 25.05.2009, at 00:21, Michael Ash wrote:


And neither should you. Your use of the dot syntax here is incorrect,
because 'string' is not a property of NSMutableString as the ObjC
language defines (however vaguely) it.


Absolutely, I only use the dot notation for accessors. I never used  
something like that in real code.


I was only using it to figure out how the compiler does the  
transformation and I was looking specifically for a class that has a  
(void)setXXX: method that is not really a property accessor.



Thanks again






_
Marc Liyanage   http://www.entropy.ch


___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


dot notation doesn’t work as expected for som e library classes

2009-05-24 Thread Marc Liyanage


I was playing around a bit with the Obj-C 2.0 dot notation to clarify  
some things for me. In my own classes getters and setters are called  
as expected, but I noticed several times already that library classes  
sometimes don’t allow the dot notation (that’s the reason why I’m  
trying to clarify this in the first place).



I’m wondering why this example with NSMutableString does not compile:

#import 

int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

NSMutableString *xyz = [NSMutableString string];
xyz.string = @"foo";

[pool drain];
return 0;
}


This fails to build with the message "error: request for member  
'string' in something not a structure or union". That message is  
expected when there is no such accessor, but it does compile when I  
replace the dot notation accessor with this:


[xyz setString:@"foo"];

This should be exactly the same. I can’t see how this could behave  
like it does when the dot notation is simply syntactic sugar, as the  
documentation states.







_____
Marc Liyanage   http://www.entropy.ch


___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Custom Google Search Engine for Mac OS X Developers

2009-02-18 Thread Marc Liyanage


I set up a Google Custom Search Engine covering Mac OS X development  
related sites a few weeks ago. Since then I've been testing and using  
it while working on my OS X programs, and I found it to be helpful in  
locating relevant information quickly.


This article has the details, including a bookmarklet, LaunchBar  
search template etc.:


http://bit.ly/macdev-info

Let me know what you think, especially if you know other useful sites  
it should cover.




_
Marc Liyanage   http://www.entropy.ch


___

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com