Re: Forcing ordered-out-window to adjust position

2010-05-15 Thread Jesper Storm Bache
I have only had the reverse problem (in some cases I need to circumvent AppKit mechanism), but have you looked at [NSWindow constrainFrameRect:frameRect toScreen:screen]:

Re: white screen windows at first

2010-04-27 Thread Jesper Storm Bache
thanks, bill On Tue, Apr 27, 2010 at 4:24 PM, Jesper Storm Bache jsba...@adobe.commailto:jsba...@adobe.com wrote: I though I saw that you said that you create windows before you call NSApplicationMain. If this is so, why are you getting draw operations? The typical use case is that you

Re: CFRunLoopStop exception

2010-04-08 Thread Jesper Storm Bache
FYI: Remember that corefoundation is open source. 10.6.2 can be found at: http://www.opensource.apple.com/source/CF/CF-550.13/ EXC_BREAKPOINT is an int 3 instruction (and HALT in CF code is typically used for this). From CFRunLoopStop from 10.6.2 sources: void CFRunLoopWakeUp(CFRunLoopRef rl)

Re: Automating Photoshop CS4?

2010-03-23 Thread Jesper Storm Bache
/photoshop_sdk Besides Apple Script, maybe UI automation (via the accessibility interface) is a possibility, but (again) I would recommend going with the AppleScript solution. Jesper Storm Bache On Mar 23, 2010, at 7:10 AM, jyoun...@kc.rr.com wrote: Just curious if there's any way to automate

Re: Cocoa equivalent for 'InstallApplicationEventHandler'

2010-02-20 Thread Jesper Storm Bache
Your comment only pertains to the addGlobal... You can use addLocalMonitor to only snoop on events in your process. From the header: = Use +addLocal to install an event monitor that receives events before they are dispatched by -[NSApplication sendEvent:]. In this case, your block should

Re: Is a good practice to alloc an object and defer the initialization to another object?

2010-02-10 Thread Jesper Storm Bache
: bar:]; Jesper Storm Bache On Feb 10, 2010, at 12:07 PM, Jens Alfke wrote: On Feb 10, 2010, at 5:27 AM, Giannandrea Castaldi wrote: I would like to alloc an object and defer the initialization to another object, is a good practice? The reason is that I can alloc several types

Re: HELP! My app crashes on startup, with a very weird stack trace.

2010-02-02 Thread Jesper Storm Bache
control doBreak = ![name isEqualToString:NSAccessibilityException]; } if (doBreak) { report_problem(...) } } Jesper Storm Bache On Feb 2, 2010, at 10:58 AM, Oleg Krupnov wrote: Thanks Ken, I don't quite understand your response

Re: HELP! My app crashes on startup, with a very weird stack trace.

2010-02-02 Thread Jesper Storm Bache
. Thanks a ton to everybody who responded!!! On Tue, Feb 2, 2010 at 9:09 PM, Jesper Storm Bache jsba...@adobe.com wrote: Are you sure you are seeing unhandled exceptions, or simply NSExceptions that are handled somewhere inside the Ax framework. If it is the latter, then you'll need to allow

Re: HELP! My app crashes on startup, with a very weird stack trace.

2010-02-02 Thread Jesper Storm Bache
, 2010, at 12:41 PM, Oleg Krupnov wrote: Good point, Jesper. But in this case, how should I catch real unhandled exceptions and send bug reports? What is the recommended best practice? Thanks! On Tue, Feb 2, 2010 at 10:22 PM, Jesper Storm Bache jsba...@adobe.com wrote: My advice is: Don't do

Re: HELP! My app crashes on startup, with a very weird stack trace.

2010-02-02 Thread Jesper Storm Bache
are thrown *and* not caught by the frameworks. I have not need to do this, and I can therefore not offer a solution that I know works. Jesper On Feb 2, 2010, at 2:37 PM, Kyle Sluder wrote: On Tue, Feb 2, 2010 at 2:28 PM, Jesper Storm Bache jsba...@adobe.com wrote: Did you try: NSException.h

Re: What is the equivalent of SetSystemUIMode() in Leopard and above?

2010-01-27 Thread Jesper Storm Bache
you change your UI modes Cons: none Jesper On Jan 26, 2010, at 9:36 PM, Charles Srstka wrote: On Jan 26, 2010, at 10:39 PM, Jesper Storm Bache wrote: I don't have the entire thread on this machine so I apologize if I am repeating someone else. When you are ready do say 10.6 and above

Re: What is the equivalent of SetSystemUIMode() in Leopard and above?

2010-01-26 Thread Jesper Storm Bache
Storm Bache On Jan 26, 2010, at 8:13 PM, Kiel Gillard wrote: On 27/01/2010, at 3:03 PM, Arun wrote: I wanted to use SetSystemUIMode() to hide the dock item and menu of my application. Do you know how can we achieve using the same? Please see the LSBackgroundOnly Info.plist key: http

Re: Window Groups in Cocoa

2010-01-05 Thread Jesper Storm Bache
There is no 1 to 1 match between Cocoa and Carbon window groups. In Cocoa you have child windows [NSWindow addChildWindow]. child windows move with their parents. Note that Cocoa does not have a notion of shared activation. Jesper On Jan 5, 2010, at 1:30 PM, Eric Gorr wrote: Was the window

Re: MallocDebug Hang with Core Data Save

2009-12-25 Thread Jesper Storm Bache
As far as I know, Apple is encouraging developers to move to Instruments. Can you use instruments with: Object Allocation or Leaks instead? Jesper On Dec 24, 2009, at 3:12 PM, Richard Somers wrote: Start with an Apple core data document based application project template. Build and start

Re: Child window shows up on top despite specifying NSWindowBelow

2009-10-20 Thread Jesper Storm Bache
(then override constrainFrameRect to not move the window back on screen). Jesper Storm Bache On Oct 20, 2009, at 10:43 AM, Francisco Tolmasky wrote: The title says it all, I set up a child window as such: [targetWindow addChildWindow:self ordered:NSWindowBelow]; But the child window shows

Re: Issue with NSView setFrame

2009-10-12 Thread Jesper Storm Bache
Maybe the fact that your view is growing while you move your mouse (and under your mouse) is causing AppKit to become confused about whether or not the mouse is inside or outside the view. What about managing your animations from a mouse-move message on the NSCollectionView? Jesper On Oct

Re: NSView clicking through to superview

2009-09-28 Thread Jesper Storm Bache
Return self from hitTest inside your overlay view. Jesper On Sep 27, 2009, at 7:36 PM, PCWiz wrote: Hi, I have a transparent black NSView that I layer over my window using NSView's addSubview method. This works fine, but I want to make it so that all clicks are captured by the NSView,

Re: Controlling Spaces and retrieving information about the current Space?

2009-09-22 Thread Jesper Storm Bache
There is very little external control over Spaces. Be sure to file enhancement request radars. So far we have the following: 1) In 10.6 you can ask a window whether or not it is on the active Space ( [NSWindow isOnActiveSpace]) 2) CGWindow.h allows you to query for the space id

Re: Why am I always getting the linker error: 'duplicate symbol'...?

2009-09-21 Thread Jesper Storm Bache
In C, the default storage class of a non-local c o n s t is extern and in C++ it is static. (the quote is from: http://www.research.att.com/~bs/examples_short.pdf) My guess is that your other application may have used C++. Therefore when you declare a const variable in a header in C you

Re: What is the life of the c string returned by NSString's UTF8String method?

2009-09-18 Thread Jesper Storm Bache
On Sep 18, 2009, at 11:04 AM, Stuart Malin wrote: I am under the impression that the reference returned by NSString's UTF8String method is valid for the life of the NSString instance which provided the reference (and further, that the memory of the referenced C string is freed when the

Re: [myNSWindow setDocumentEdited:dirtyB] fail ??

2009-09-17 Thread Jesper Storm Bache
(these are available in both 32 and 64 bit) and logging enhancement radars. Jesper Storm Bache ___ 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

Re: Debug-level messages don't appear in Console even after asl_set_filter()

2009-09-16 Thread Jesper Storm Bache
This is by design. The syslogd daemon filters such messages out. See man syslog (and possibly also man syslogd) on how to change the server side filtering. Jesper On Sep 16, 2009, at 8:22 AM, Sidney San Martín wrote: Messages that I log below ASL_LEVEL_NOTICE aren't showing up in Console

Re: Debug-level messages don't appear in Console even after asl_set_filter()

2009-09-16 Thread Jesper Storm Bache
usually has a value that indicates to the library that it is off, and thus it has no effect. Calling syslog -c 0 and syslog -c process on my machine both print ... filter mask: Off. On Wed, Sep 16, 2009 at 11:38 AM, Jesper Storm Bache jsba...@adobe.com wrote: This is by design. The syslogd

Re: Finding and NSView in a window

2009-09-16 Thread Jesper Storm Bache
the top most would be the content view. If you mean the inner-most view, then get the content view and then use [NSView hitTest] on that view (after you translate the coordinates to the coordinate space of the content view). Jesper On Sep 16, 2009, at 1:04 PM, David Alter wrote: Is there

Re: Custom Window not receiving full shadow

2009-09-05 Thread Jesper Storm Bache
Custom windows not getting the default document shadow is a known issue: radar 6446459 Cocoa need document style shadow for custom windows Jesper Storm Bache On Sep 5, 2009, at 1:02 AM, Francisco Tolmasky wrote: This is a normal window, except it is borderless, which means it falls under

Re: Minimum alpha value for transparent windows

2009-09-04 Thread Jesper Storm Bache
If you are interested in mouse events in your entire window area, then you can use [NSWindow setIgnoresMouseEvents:NO] and not have to worry about faint paint issues. Jesper Storm Bache Core Technologies Adobe Systems Inc On Sep 4, 2009, at 4:02 PM, Gabriel Zachmann wrote: I've got

Re: Converting colors to CGFloat

2009-07-31 Thread Jesper Storm Bache
Given that QD is not color managed, I would expect that you should use [NSColor colorWithDeviceRed..] rather than the calibrated variation. (I must admit that I find the documentation regarding calibrated and device rather thin in various NSColor references). Jesper On Jul 31, 2009, at 8:44

Re: [NSEvent data1]

2009-07-29 Thread Jesper Storm Bache
This is not a problem with your understanding, but a known problem on 10.5: 6361482 AppKit 64 bit truncation of data1 and data2 when posting a custom event For 10.5 splitting up the data is probably the best way to go Jesper Storm Bache On Jul 29, 2009, at 4:52 PM, kvic...@pobox.com wrote

Re: Fixing logged error that doesn't throw exception

2009-06-25 Thread Jesper Storm Bache
You should be able to set a break point on asl_send Jesper On Jun 25, 2009, at 2:34 AM, Tristan Celder wrote: Hi, I'm extremely new to Cocoa programming but have come across a problem where I am getting a [NSConcreteAttributedString initWithString:] called with nil string argument. pop up in

Re: Just implementing -isEqual:, never invoked, causes crash

2009-06-19 Thread Jesper Storm Bache
In general, make sure to match the types of methods that you override (the obj-c runtime does not consider types). The signature of isEqual is: - (BOOL)isEqual:(id)object; Note the id type for the argument (however, if Browfile is an obj-c class, then things ought to work, so I assume

Re: NSString initWithFormat and stringWith

2009-05-28 Thread Jesper Storm Bache
Does your latest statement mean that the following (from http://developer.apple.com/documentation/CoreFoundation/Conceptual/CFBundles/Tasks/loading.html#/ /apple_ref/doc/uid/20001127-124675) is incorrect/obsolete information: You can unload the contents of a CFBundle object using

Re: NSString initWithFormat and stringWith

2009-05-27 Thread Jesper Storm Bache
memory rules. The Leaks tool can assist in finding areas where you forgot to release objects. And the zombie mechanism can be used to track down over releases. (since you are on the iPhone garbage collection is not an option). Jesper Storm Bache Core Technologies Adobe Systems Inc Any

Re: NSString initWithFormat and stringWith

2009-05-27 Thread Jesper Storm Bache
a pointer to that TEXT segment around. When the bundle/plug-in unloads the segment is removed from the mapped memory and you'll get a crash if you try to use it. Therefore, unloadable plug-ins (that use cfstrings) should use fno- constant-cfstrings. Jesper Storm Bache On May 27, 2009

Re: When init returns nil does it cause a leak

2009-05-19 Thread Jesper Storm Bache
expect that your storage may already have been deleted. Jesper Storm Bache On May 19, 2009, at 9:24 AM, Reza Farhad wrote: Hi all we have an object that gets initialized like most other objects -(id)init { self = [ super init ]; if ( self ){ ...do something

Re: When init returns nil does it cause a leak

2009-05-19 Thread Jesper Storm Bache
On May 19, 2009, at 10:58 AM, Quincey Morris wrote: On May 19, 2009, at 09:32, Jesper Storm Bache wrote: I personally disagree with the Apple recommendation, and I vote for calling [super dealloc] when initialization fails - because this will invoke dealloc only in the base classes where init

Re: When init returns nil does it cause a leak

2009-05-19 Thread Jesper Storm Bache
I did talk to an Apple engineer about this and when I argued for [super dealloc] I was told that it would be fine. I then logged a radar against the seemingly incorrect documentation, I got a reply stating that [self release] is the recommended approach by the AppKit team. My radar was

Re: C++ constructors.

2009-05-13 Thread Jesper Storm Bache
Your copy constructor is atypical because the argument is not const (or a non reference). You could change it to be: Cbyte1::Cbyte1 (const Cbyte1 val) Secondly, it looks like your class is a template. In that case you may either want: template typename T class Cbyte1 {

Re: Converting NSString to C++ std::string

2009-05-08 Thread Jesper Storm Bache
That should work. Where are you crashing - and what is your crash log? My guess is that something else is not right (are you sure that myNSTextField is a valid object)? Jesper Storm Bache On May 7, 2009, at 2:38 PM, Andrew Wood wrote: Im using a library which requires arguments to be C

Re: NSXMLParser frees itself on error?

2009-05-04 Thread Jesper Storm Bache
Storm Bache On Apr 30, 2009, at 11:59 PM, Mike Manzano wrote: Hi Folks, I have an NSXMLParser doing parsing the contents of a URL. It is allocated like this: _showsParser = [[NSXMLParser alloc] initWithContentsOfURL:url]; Given a good URL to a parsable XML document, its

Re: NSXMLParser frees itself on error?

2009-05-04 Thread Jesper Storm Bache
. Butler wrote: On Fri, May 1, 2009 at 11:18 AM, Jesper Storm Bache jsba...@adobe.com wrote: I have not used NSXMLParser, but as far as I can tell from your email, cleanupShowParsing is called in response to a call to the parser delegate. In that case, you should not release the parser

Re: Importing Word doc in Carbon app via Cocoa

2009-04-16 Thread Jesper Storm Bache
in main at DogbertMain.cp:146 Jesper Storm Bache Core Technologies Adobe Systems Inc ___ 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

Re: warning for unsigned parameter, signed argument with NSUInteger

2009-04-14 Thread Jesper Storm Bache
treats NSUInteger as a 64-bit unsigned integer...) Jesper Storm Bache On Apr 14, 2009, at 7:20 AM, Drew Lawson wrote: [again, sending to list] According to Roland King: but not this. NSUInteger is just a typedef isn't it, so this is really unsigned int / int and I was expecting a warning

Re: NS - CG Rect Conversion and screen coordinates

2009-04-01 Thread Jesper Storm Bache
. In a system without display mirroring, the display with the menu bar is typically the main display. === I would expect that CGRectGetHeight(CGDisplayBounds (CGMainDisplayID ())) == zeroScreenHeight()? Jesper Storm Bache Core Technologies Adobe Systems Inc On Apr 1, 2009, at 12:25 PM

Re: NS - CG Rect Conversion and screen coordinates

2009-04-01 Thread Jesper Storm Bache
update). Jesper On Apr 1, 2009, at 3:27 PM, Peter Ammon wrote: My mistake, I saw mainScreenRect and assumed it was the frame of what Cocoa calls the main screen. -Peter On Apr 1, 2009, at 2:52 PM, Jesper Storm Bache wrote: Forgive me for being dense. Where is the subtle bug? The code

Re: code for drawing an NSTextField to a panel window ...

2009-03-12 Thread Jesper Storm Bache
Your implementation of init is wrong. You are returning nil which means that initialization failed. You should be doing something like: - (id) initWithContentRect: (NSRect) contentRect styleMask: (NSUInteger) windowStyle backing: (NSBackingStoreType)

Re: setFrame: not working in custom event loop

2009-03-10 Thread Jesper Storm Bache
explicit tracking? You should be able to simply listen for mouseDragged, mouseDown, and mouseUp on your split view (if this is a custom sub-class). Jesper Storm Bache On Mar 10, 2009, at 2:51 PM, Mike Manzano wrote: Hi, I am tracking the mouse pointer to dynamically resize a splitter

RE: Debugging the dreaded CoreData could not fulfill a fault....

2009-02-27 Thread Jesper Storm Bache
If that is the only message you see in the console, then you can try to break on asl_send. Jesper Storm Bache From: cocoa-dev-bounces+jsbache=adobe@lists.apple.com [cocoa-dev-bounces+jsbache=adobe@lists.apple.com] On Behalf Of Jerry Krinock [je

RE: Profiling with Shark

2009-02-15 Thread Jesper Storm Bache
application, then I would suggest: - Log a radar - While you wait for a response/fix from Apple, move your project to a path name with roman characters and use that to improve your performance Jesper Storm Bache From: cocoa-dev-bounces+jsbache=adobe

Re: respondsToSelector works in app project, not in library?

2009-01-12 Thread Jesper Storm Bache
and then out on the other side of the method invocation. Jesper Storm Bache On Jan 12, 2009, at 12:08 PM, Alex Kac wrote: We have a piece of code that we have in the main source of a project as well as a static library in another project. SEL action = NSSelectorFromString

Re: Is it useful to make a 64 bit app? [Was]: How can users check if their mac is 64-bit-capable?

2008-12-11 Thread Jesper Storm Bache
from int to NSInteger is therefore probably not appropriate, but a switch to NSInteger is needed when you want to store the result of any API that returns an NSInteger. Jesper Storm Bache ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com

Re: Window moving during drag and drop operation, (newbiew question)

2008-12-07 Thread Jesper Storm Bache
Are you using a metal style window (NSTexturedBackgroundWindowMask). If so, then you will want to look into how [NSView mouseDownCanMoveWindow] works (try overriding it and return NO) Jesper Storm Bache On Dec 6, 2008, at 6:39 AM, Gustavo Pizano wrote: On 6.12.2008, at 12:20, Gustavo

Re: How do you get the OS X version number in C or C++?

2008-11-14 Thread Jesper Storm Bache
gestaltSystemVersion is not the best way to do it (and it caused problems in 10.4.10 and up). As the documentation in Gestalt.h states: ... A better way to get version information on Mac OS X would be to use the new gestaltSystemVersionMajor, gestaltSystemVersionMinor, and

Re: Retain

2008-10-24 Thread Jesper Storm Bache
with the Leaks tool frequently and also run with debugmalloc (also know that obj-c 2 has a garbage collection option). Jesper Storm Bache On Oct 23, 2008, at 10:24 PM, Ron Green wrote: If I call NSString w = [NSString stringWithFormat:@something %i, x]; Am I now suppose to call retain on w? When I'm

RE: Getting Carbon EventRef from cocoa NSEvent

2008-10-23 Thread Jesper Storm Bache
If you look in NSEvent.h you will see : #if MAC_OS_X_VERSION_MAX_ALLOWED = MAC_OS_X_VERSION_10_5 /* -eventRef and +eventWithEventRef: are valid for all events */ /* -eventRef returns an EventRef corresponding to the NSEvent. The EventRef is retained by the NSEvent, so will be valid as long as