Re: NSRulerView and inches

2010-01-22 Thread Quincey Morris
On Jan 21, 2010, at 16:26, Graham Cox wrote: Note that rulers automatically deal with the view's zoom so you don't normally have to factor that in manually. I'd say that letting the view do the scaling is definitely the easiest way to do it, through its -scaleUnitSquareToSize: method.

Re: CALayer resizing puzzle

2010-01-22 Thread douglas welton
Vincent, Have you checked the values of dx and dy in the debugger? Shouldn't those variables be declared as CGFloats as opposed to int? In regards to resizing the layer when the enclosing view resizes, what values have you set for the layer's autorezingMask property? regards, douglas On

Performance of NSArrayController update with Display Pattern bindings

2010-01-22 Thread Grant Christensen
Hi all, Are their any known performance limitations with display pattern bindings when updating the data in the underlying arraycontroller? I have two fields in a table that use them, and they concatenate three values together, so each of the two fields is using three display patterns with a

How to avoid launching the same application multiple times?

2010-01-22 Thread Ramesh P
Hi all, I copied my cocoa application and pasted in multiple folders. Now i double clicked all the application icons. Now I am seeing multiple windows of same application. How can i avoid this? Thanks in advance, Ramesh.P ___ Cocoa-dev mailing list

Re: NSHost and NSStream question

2010-01-22 Thread Mathieu Coursolle
Hi, I finally fixed my problem. The server was not opening the port properly, so the client could not connect. It as error 61 of POSIX domain. Seems to work fine now. Thanks, Mathieu On 2010-01-21, at 4:37 PM, Jens Alfke wrote: On Jan 21, 2010, at 6:43 AM, Mathieu Coursolle wrote: If I

UIImageView display as multiply?

2010-01-22 Thread Eric E. Dolecki
I am loading up a table with contents from an XML file and loading images into some cells. Since these images were made for the web some have white backgrounds. I would like to somehow set them as multiply as one might do in Photoshop to make the white go away. Blendmode kind of thing. Do I need

Weird exception

2010-01-22 Thread Alexander Bokovikov
Hi, All, Browsing the console log I've found that my app raises an exception, when it is launched in Mac OS X 10.4. I built it in 10.5 with 10.4 as a target setting. I didn't see any problems there. The exception is caused by unsupported selector calling [NSString boolValue]. I've

Re: How to avoid launching the same application multiple times?

2010-01-22 Thread Dave Keck
LSMultipleInstancesProhibited may be what you're looking for. ___ 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

Re: CALayer resizing puzzle

2010-01-22 Thread vincent habchi
Douglas, Have you checked the values of dx and dy in the debugger? Shouldn't those variables be declared as CGFloats as opposed to int? That's correct, but it does not matter since the int is automatically converted to float/double. Actually this part of code works like a charm. You click,

Re: NSTabViewDelegate

2010-01-22 Thread Jerry Krinock
On 2010 Jan 21, at 16:18, Paul Forgey wrote: Are there any known conditions under which an NSTabView won't call its delegate methods? No. Both tabView:willSelectTabViewItem: and tabView:didSelectTabViewItem: work fine for me, and I don't see anything wrong with the code you posted. You

iPhone: subclassing UIView for blendmode

2010-01-22 Thread Eric E. Dolecki
Sorry this is a noob question, but I am try to get blendmode to work for images. What I have done so far that seems to do nothing: I create a new class called ImageView which subclasses UIView. I have done nothing in the initWithFrame, only in drawRect: - (void)drawRect:(CGRect)rect {

Re: UIImageView display as multiply?

2010-01-22 Thread Luke the Hiesterman
You should perform whatever blending you need to do on the image itself to create a new image which you can then just put into a UIImageView like you would any other image. This way, you only have to blend once, and then it's just image that can be straight drawn rather than performing a

Re: UIImageView display as multiply?

2010-01-22 Thread Eric E. Dolecki
Okay, how would I go about doing that? On Fri, Jan 22, 2010 at 9:52 AM, Luke the Hiesterman luket...@apple.comwrote: You should perform whatever blending you need to do on the image itself to create a new image which you can then just put into a UIImageView like you would any other image.

Re: Correct Bindings Practices

2010-01-22 Thread Jerry Krinock
On 2010 Jan 21, at 04:02, Quincey Morris wrote: The other issue that needs care in regard to both your questions is undo. When setters do a lot of work, you need to be careful about what happens at undo or redo time. Quincey gives good advice here as usual. In particular, the undo

KVO and object release timing (for a NSCollectionView)

2010-01-22 Thread vincent habchi
Hi again, in my project, I have a managed object A, that has a relationship to an other managed object B, itself in relation with a third object C (which happens to be a CALayer, therefore is not part of Core Data): A - B - C. The object A I register in a NSArrayController, whose content is

Re: How to avoid launching the same application multiple times?

2010-01-22 Thread Ramesh P
Thanks Deve, It is working fine. But i am getting a message says another user is running the same application. But i am the only user using the application.Is there any way to customize the alert message? or any other solutions for this? Thanks, Ramesh.P On Fri, Jan 22, 2010 at 7:40 PM, Dave

Re: UIImageView display as multiply?

2010-01-22 Thread Luke the Hiesterman
Create a context with UIGraphicsBeginImageContext, apply your blend, and get the image out of the context with UIGraphicsGetImageFromCurrentImageContext, and don't forget to end your context. Luke On Jan 22, 2010, at 6:59 AM, Eric E. Dolecki wrote: Okay, how would I go about doing that?

Re: NSNumberFormatter question - showing mixed state

2010-01-22 Thread jonat...@mugginsoft.com
On 22 Jan 2010, at 04:06, Graham Cox wrote: I have text fields which use NSNumberFormatters that occasionally need to show a mixed value. My preferred design is that when they contain a mixed value, they show '--'. My problem is that I can't seem to get the formatters to return this

Re: UIImageView display as multiply?

2010-01-22 Thread Eric E. Dolecki
This is what I have so far (my UIImageView is in a table cell, no image below it... I'd like the blend mode to handle when I select a row in the table (the uiimageview image should blend into the selected row color) - what I have isn't working (shows white around edges of the image) - I also have

Re: How to avoid launching the same application multiple times?

2010-01-22 Thread Dave Keck
It is working fine. But i am getting a message says another user is running the same application. But i am the only user using the application.Is there any way to customize the alert message? or any other solutions for this? I doubt the message is customizable. To implement the functionality

Re: UIImageView display as multiply?

2010-01-22 Thread Bertil Holmberg
Here is a snippet that I saved for another day, perhaps it will get you going? Regards, Bertil - (UIImage *)blendOverlay:(UIImage *)topImage withBaseImage:(UIImage *)baseImage toSize:(CGFloat)imageSize { UIGraphicsBeginImageContext(CGSizeMake(imageSize, imageSize)); [baseImage

Re: Weird exception

2010-01-22 Thread Keary Suska
On Jan 22, 2010, at 7:10 AM, Alexander Bokovikov wrote: Hi, All, Browsing the console log I've found that my app raises an exception, when it is launched in Mac OS X 10.4. I built it in 10.5 with 10.4 as a target setting. I didn't see any problems there. The exception is caused by

Re: UIImageView display as multiply?

2010-01-22 Thread Eric E. Dolecki
I'm not combining two or more images, I merely would like a single uiimage in a uiimageview to have a blend mode applied to it that works so that no matter what is beneath it, there will be a blend mode applied. Is this not possible? On Fri, Jan 22, 2010 at 10:43 AM, Bertil Holmberg

Re: UIImageView display as multiply?

2010-01-22 Thread Tom Davie
An image doesn't carry a blend mode, merely the image data. You *draw* the image in a given blend mode. Bob On Fri, Jan 22, 2010 at 3:52 PM, Eric E. Dolecki edole...@gmail.com wrote: I'm not combining two or more images, I merely would like a single uiimage in a uiimageview to have a blend

Re: Best practices for using standard window widgets in a custom window

2010-01-22 Thread Kevin Wojniak
I didn't pull my code from Chromium, I just noticed in my googling that they used the undocumented method that is required to get the mouse over effects to work. I ended up sticking with the standard Cocoa buttons that NSWindow provides for my custom window as it requires the least amount of

Re: CALayer resizing puzzle

2010-01-22 Thread David Duncan
On Jan 21, 2010, at 11:53 PM, vincent habchi wrote: Does that mean that the content property is altered not only when you set it explicitly, but also when you draw on the layer via [DrawLayer: inContext:]? Yes it is. The contents property is generally used to represent bitmapped content of

Re: iPhone: subclassing UIView for blendmode

2010-01-22 Thread David Duncan
On Jan 22, 2010, at 6:49 AM, Eric E. Dolecki wrote: Sorry this is a noob question, but I am try to get blendmode to work for images. What I have done so far that seems to do nothing: I create a new class called ImageView which subclasses UIView. I have done nothing in the initWithFrame,

Re: UIImageView display as multiply?

2010-01-22 Thread David Duncan
On Jan 22, 2010, at 7:52 AM, Eric E. Dolecki wrote: I'm not combining two or more images, I merely would like a single uiimage in a uiimageview to have a blend mode applied to it that works so that no matter what is beneath it, there will be a blend mode applied. Is this not possible? It

patching the responder chain: puzzled by the docs

2010-01-22 Thread Andy Lee
My understanding was that it's okay to insert things anywhere you want in the responder chain. In particular, it's okay to put a a view controller between its view and the view's superview. I know I'm not alone in this: * Buck and Yacktman say so in Cocoa Design Patterns, in the section

Re: CALayer resizing puzzle

2010-01-22 Thread vincent habchi
David, Yes it is. The contents property is generally used to represent bitmapped content of a layer, which in the case of a plain CALayer means that anything drawn via -drawInContext: or -drawLayer:inContext: will be accessible via the contents property. Thanks for that answer. I would

Re: CALayer resizing puzzle

2010-01-22 Thread David Duncan
On Jan 22, 2010, at 10:18 AM, vincent habchi wrote: Thanks for that answer. I would dare a further request for enlightenment ;) Does it mean that: 1. by defining a suitable ContentsRect, I can get a clipped area of a CALayer just by accessing layer.contents? 2. that I can copy this

Imitating Behavior of a Sheet Window

2010-01-22 Thread Oleg Krupnov
I'd like to create a window that would behave exactly as a sheet, except that it doesn't slide down from the window title bar, but fades in instead. The sheet should be modal, but the parent window should still be resizable and closable. For this reason (and also some others), I can't use [NSApp

Re: CALayer resizing puzzle

2010-01-22 Thread vincent habchi
Le 22 janv. 2010 à 19:41, David Duncan a écrit : This will set layer1 and layer2 to use the same contents, and have them use different parts of that bitmap. However your contentsRect is being set incorrectly. The contentsRect is a rectangle in a unit coordinate system, which means that

Re: Imitating Behavior of a Sheet Window

2010-01-22 Thread Andy Lee
On Friday, January 22, 2010, at 02:27PM, Oleg Krupnov oleg.krup...@gmail.com wrote: I'd like to create a window that would behave exactly as a sheet, except that it doesn't slide down from the window title bar, but fades in instead. The sheet should be modal, but the parent window should still

Re: Imitating Behavior of a Sheet Window

2010-01-22 Thread Oleg Krupnov
Thanks Andy. Here's more info. The sheet is a semi-transparent nag window with some text and a couple of buttons, that overlaps the main window. The sheet does not have a shadow, so there is no problem to reproduce it. The nag window is automatically resized together with the parent window so

Re: KVO and object release timing (for a NSCollectionView)

2010-01-22 Thread Corbin Dunn
On Jan 22, 2010, at 7:01 AM, vincent habchi wrote: I have a NSButton in C to remove from the array controller the A object it represents. However, each time I click on that button, I first get a warning telling me that I remove an observed object before releasing the observer, and then

Re: Imitating Behavior of a Sheet Window

2010-01-22 Thread Andy Lee
On Friday, January 22, 2010, at 04:18PM, Oleg Krupnov oleg.krup...@gmail.com wrote: Thanks Andy. Here's more info. The sheet is a semi-transparent nag window with some text and a couple of buttons, that overlaps the main window. The sheet does not have a shadow, so there is no problem to

View Handling

2010-01-22 Thread David Blanton
I have two views that need to occupy the same space and have their visibility toggled via an action. I first overlaid one on the other setting it hidden, all done in IB. Then in code set one hidden the other visible at which time it dawned on me that one view was contained in the other and

Re: View Handling

2010-01-22 Thread David Duncan
On Jan 22, 2010, at 1:57 PM, David Blanton wrote: So my question. What is the 'proper' means of handling this situation? Rearrange the views to be siblings instead of parent-child in Interface Builder? -- David Duncan Apple DTS Animation and Printing

NSImage loads garbage every other time?!?

2010-01-22 Thread sebi
Hello, this is the weirdest thing i saw in a while. I load an image with [NSImage imageNamed:@someName.png]; the image is has a size of (159, 256) Every other time I start the app in the debugger the loaded image reports a size of (23, 36.4812) and contains only garbage of some old image I

rightMouseDown not working as documented?

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

Re: View Handling

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

Re: View Handling

2010-01-22 Thread Scott Anguish
NSTabView with tabs that aren’t visible? On Jan 22, 2010, at 4:57 PM, David Blanton wrote: I have two views that need to occupy the same space and have their visibility toggled via an action. I first overlaid one on the other setting it hidden, all done in IB. Then in code set one

Re: View Handling

2010-01-22 Thread Ron Fleckner
On 23/01/2010, at 8:57 AM, David Blanton wrote: I have two views that need to occupy the same space and have their visibility toggled via an action. I first overlaid one on the other setting it hidden, all done in IB. Then in code set one hidden the other visible at which time it dawned

Re: View Handling

2010-01-22 Thread David Blanton
NSTabView w/o tabs ... yeah that's the ticket! Thanks. -db On Jan 22, 2010, at 4:45 PM, Scott Anguish wrote: NSTabView with tabs that aren’t visible? On Jan 22, 2010, at 4:57 PM, David Blanton wrote: I have two views that need to occupy the same space and have their visibility toggled

Re: View Handling

2010-01-22 Thread Kyle Sluder
On Fri, Jan 22, 2010 at 1:57 PM, David Blanton aired...@tularosa.net wrote: 1. Remove View 1 from window content view 2. Add View 2 to window content view 3. Position View 2. This is quite common. Tabless NSTabViews are as well. --Kyle Sluder ___

Re: rightMouseDown not working as documented?

2010-01-22 Thread Corbin Dunn
Howdy, NSView doesn't call up the responder chain for rightMouseDown:. It calls -menuForEvent:, and if non nil, presents the contextual menu. Please log a bug requesting our documentation to clarify this, or asking us to change the behavior if you were expecting something else. corbin On

Question regarding response time between UIScrollView and UIButton

2010-01-22 Thread Steven Noyes
The basic question is: How do I maintain fast response on buttons held as contents in a UIScrollView but cancel the UIButton press event and forward swiping back up to the UIScrollView superview when the finger starts dragging? The view hierarchy looks like: UIScrollView (delayContentTouches

Re: rightMouseDown not working as documented?

2010-01-22 Thread Jens Alfke
On Jan 22, 2010, at 4:20 PM, Corbin Dunn wrote: NSView doesn't call up the responder chain for rightMouseDown:. It calls -menuForEvent:, and if non nil, presents the contextual menu. Please log a bug requesting our documentation to clarify this, or asking us to change the behavior if you

Re: NSNumberFormatter question - showing mixed state

2010-01-22 Thread Graham Cox
On 23/01/2010, at 2:19 AM, jonat...@mugginsoft.com wrote: I see the same behaviour when subclassing NSNumberFormatter. - (NSString *)stringForObjectValue:(id)anObject always receives an NSNumber. If you subclass NSFormatter directly then you can probably gain the control you need and

Re: rightMouseDown not working as documented?

2010-01-22 Thread Corbin Dunn
On Jan 22, 2010, at 4:57 PM, Jens Alfke wrote: On Jan 22, 2010, at 4:20 PM, Corbin Dunn wrote: NSView doesn't call up the responder chain for rightMouseDown:. It calls -menuForEvent:, and if non nil, presents the contextual menu. Please log a bug requesting our documentation to clarify

Re: rightMouseDown not working as documented?

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

Re: Imitating Behavior of a Sheet Window

2010-01-22 Thread John Joyce
It might be worth considering simply loading a layer backed view. You may not need a full child window. If it is very different from a standard sheet, keep it different. Avoid confusing users. It's recommended to follow the HIG as much as possible. Sent from my iPhone

Re: Imitating Behavior of a Sheet Window

2010-01-22 Thread Gregory Weston
Andy Lee wrote: This works perfectly except for a single little problem. The title bar of the parent window and its traffic light window buttons are grayed our like if the parent window wasn't key window (which is true though). However, when a natural sheet is showing, the title bar of the

Re: NSImage loads garbage every other time?!?

2010-01-22 Thread sebi
Never mind, I found out that I had two images with the same name in two different resource folders. Since Xcode doesn't create subfolders within the apps resource folder it copies only one of the images. Thats fine, however it's still interesting why it takes them in turns and why it reports