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]: http://developer.apple.com/mac/library/documentation/cocoa/reference/ApplicationKit/Classes/NSWindow_Class/Reference/Reference

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 mailto: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 create windows

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
oshop/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, wrote: > Just curious if there's any way to automate Adobe

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

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

2010-02-02 Thread Jesper Storm Bache
xceptions 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 wrote: >> D

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

2010-02-02 Thread Jesper Storm Bache
Feb 2, 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 wrote: &

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

2010-02-02 Thread Jesper Storm Bache
ibility Inspector > utility. And I have fixed it as advised. > > Thanks a ton to everybody who responded!!! > > > On Tue, Feb 2, 2010 at 9:09 PM, Jesper Storm Bache wrote: >> Are you sure you are seeing "unhandled exceptions", or simply "NSExceptions" >

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

2010-02-02 Thread Jesper Storm Bache
// exceptions for flow 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, >

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

2010-01-27 Thread Jesper Storm Bache
10.6 when you change your UI modes Cons: 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. >>

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

2010-01-26 Thread Jesper Storm Bache
naries. Jesper 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

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 wi

Re: Child window shows up on top despite specifying NSWindowBelow

2009-10-20 Thread Jesper Storm Bache
f screen and make then visible (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 or

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 1

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 (kCGWindowWorks

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 cr

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 NSSt

Re: [myNSWindow setDocumentEdited:dirtyB] fail ??

2009-09-17 Thread Jesper Storm Bache
sers and decided that they would not like the change. We therefore I ended up using HITheme APIs (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) Pl

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: Debug-level messages don't appear in Console even after asl_set_filter()

2009-09-16 Thread Jesper Storm Bache
ster filter mask 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, Jes

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: 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

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: &g

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 m

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 assum

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 CFBundleUnlo

Re: NSString initWithFormat and stringWith

2009-05-27 Thread Jesper Storm Bache
you end up passing 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

Re: NSString initWithFormat and stringWith

2009-05-27 Thread Jesper Storm Bache
act ref-count values, but rather on making sure that you follow the Cocoa 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

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 closed

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
hould 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 some

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 class Cbyte1 { Cbyte1 (const

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
M, Stephen J. Butler wrote: On Fri, May 1, 2009 at 11:18 AM, Jesper Storm Bache 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 (bec

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: Importing Word doc in Carbon app via Cocoa

2009-04-16 Thread Jesper Storm Bache
p::Run at fApp.cp:2432 #11 0x001eed79 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. C

Re: warning for unsigned parameter, signed argument with NSUInteger

2009-04-14 Thread Jesper Storm Bache
ation 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

Re: NS <-> CG Rect Conversion and screen coordinates

2009-04-01 Thread Jesper Storm Bache
umentation 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? T

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: 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) bufferin

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 as a

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 Jerr

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: NSView behaves different on 10.4 vs 10.5?

2009-01-29 Thread Jesper Storm Bache
ix of opengl and coregraphics based views), then sibling clipping does not work (but container clipping does). Jesper Storm Bache ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the

Re: Spaces: Receiving a space change notification.

2009-01-28 Thread Jesper Storm Bache
ot;an application on all Spaces", think "my windows on all Spaces" (or some of my windows on all Spaces). See NSWindowCollectionBehavior in NSWindow Jesper Storm Bache h.a. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Plea

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 = NSSelector

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
ral switch 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

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:2

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 gestaltSystemVers

Re: Retain

2008-10-24 Thread Jesper Storm Bache
uncertain about memory management, be sure to run 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 stringWithFor

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