Re: NSTerminateLater and thread

2011-06-03 Thread Peter Lübke
struggle myself some day more on this issue. Let's cross the fingers. Regards -- Leonardo Da: Kyle Sluder Data: Fri, 3 Jun 2011 11:35:41 -0700 A: Peter Lübke Cc: Leonardo , Cocoa Developers Oggetto: Re: NSTerminateLater and thread 2011/6/3 Peter Lübke : Return NS

Re: NSTerminateLater and thread

2011-06-03 Thread Peter Lübke
Return NSTerminateCancel when applicationShouldTerminate calls ExecuteLogOutTask to be performed in a secondary thread. At the end of your ExecuteLogOutTask method, call something like [myApplicationDelegate performSelectorOnMainThread: (logOutTaskDidFinish) withObject:nil waitUntilDone:NO].

Re: Properly comparing file NSURLs for equality?

2011-05-27 Thread Peter Lübke
difference is only the 'localhost' part. :( Yes I know. ( [myAnswer wasAbsolutelyPointless] == YES ); Am 28.05.2011 um 01:38 schrieb Peter Lübke: [ [someURL absoluteURL] isEqual:[otherURL absoluteURL]] should return correct results. __

Re: Properly comparing file NSURLs for equality?

2011-05-27 Thread Peter Lübke
[ [someURL absoluteURL] isEqual:[otherURL absoluteURL]] should return correct results. Cheers, Peter Am 28.05.2011 um 01:13 schrieb Sean McBride: Hi all, What is the correct way to test if two NSURLs refer to the same file system object? I've just learnt the hard way that one can have two

Table view with NSImageCell scrolls A LOT slower with bindings than with dataSource

2011-05-07 Thread Peter Lübke
Hi all, I have a table view with all columns bound to keys of an NSArrayController. The array controller implements some data source methods, mainly for drag and drop support. One of the columns uses an NSImageCell to display 32 x 32 icons. Scrolling the table view vertically gets very slow

Re: delete entries in a tableView with the backspace-key on the keyboard

2011-04-29 Thread Peter Lübke
Am 29.04.2011 um 23:19 schrieb Sean McBride: See: Sean, is there a special reason why the sample code is working with [event characters]? I've merely been doing if ( [event keyCode] == 51) { ... } to

Re: Aliases with NDAlias not appearing where I tell them to be.

2011-04-27 Thread Peter Lübke
Am 27.04.2011 um 21:09 schrieb Quincey Morris: ..., and I don't see NDAlias having a documented 'writeToFile' method at all, and (even if it did) ... It actually does, as I just found out looking at Nathan Day's homepage: http://homepage.mac.com/nathan_day/pages/source.xml He and Sean McBride

Re: icon radio buttons, NSToolbar?

2011-04-18 Thread Peter Lübke
In cases alike I sometimes find the UIElementInspector application quite helpful to get an idea about which objects make up a view hierarchy. - Peter Am 19.04.2011 um 00:50 schrieb Todd Heberlein: I'm trying to get a row of buttons to look and behave like the buttons across the Preview a

Re: renaming directories and moving files into them (NSFileManager)

2011-04-15 Thread Peter Lübke
Am 15.04.2011 um 08:51 schrieb Scott Anguish: It always creates a new directory wit the new name, in the existing shootPath directory (for example /tmp/boo/Friday) with Friday-APPL instead. and then copies the newly found files into that. If I get you right, the *real* path for the new dir

Re: Preventing View Update in NSTableView

2011-04-14 Thread Peter Lübke
Silly me! The data model objects *do *set some of their bound ivars when performing the task in question on the background thread (writing to files, sending apple events ...). I was using a data source before, so this was no problem. I just rewrote my code to use bindings / NSArrayControlle

Re: Preventing View Update in NSTableView

2011-04-14 Thread Peter Lübke
Am 14.04.2011 um 04:20 schrieb Graham Cox: On 14/04/2011, at 10:13 AM, Peter Lübke wrote: I'd like to temporarily 'freeze' the cells in the table view while the data displayed in those cells are changed so they are not continuously redrawn. When the changes are completed,

Preventing View Update in NSTableView

2011-04-13 Thread Peter Lübke
Hi, I have an NSTableView subclass bound to an NSArrayController. I'd like to temporarily 'freeze' the cells in the table view while the data displayed in those cells are changed so they are not continuously redrawn. When the changes are completed, they should be updated at once. For variou

Re: How to enable accessibility for Screen Change

2011-04-13 Thread Peter Lübke
You should rather post your question to Accessibility- d...@lists.apple.com. Am 13.04.2011 um 11:30 schrieb Symadept: Hi, I am looking for a multiview app, if I am navigating to Page 2 from Page 1 is there a way I can enable accessibility such that, Voice Over can read as I am transition

Re: Display a "Red frame" on the screen

2011-04-08 Thread Peter Lübke
Am 08.04.2011 um 19:24 schrieb eveningnick eveningnick: I was thinking about the window. But then it has to be something with a big hole inside. This hole ought to be transparent for mouse clicks (so if there's something below my "window", that 'something' has to be clickable and focused, and r

Re: Access main window of other Applications

2011-04-08 Thread Peter Lübke
Am 07.04.2011 um 17:01 schrieb Florian Pilz: Hi there! I'm looking for an easy way to access the main window of another Application, thus not my own. (The key window would be fine as well, if that is easier.) I already searched via Google to solve this task and I found the following solutions:

Re: API to determine a list of installed scriptable applications

2011-04-03 Thread Peter Lübke
Am 02.04.2011 um 11:56 schrieb jonat...@mugginsoft.com: Is there an API to determine a list of installed scriptable applications? Such a list is displayed by the AppleScript Editor menu item Open Dictionary... Application bundles can be queried for using MDQuery and the scriptability o

Re: Hash Values in Custom Classes

2011-03-29 Thread Peter Lübke
Am 29.03.2011 um 23:26 schrieb Jean-Daniel Dupas: Am 28.03.2011 um 20:06 schrieb Sean McBride: Are you aware that starting in 10.6, the OS provides 'file reference URLs' which are much like FSRefs. See: Good

Re: Hash Values in Custom Classes

2011-03-29 Thread Peter Lübke
Am 28.03.2011 um 20:06 schrieb Sean McBride: Are you aware that starting in 10.6, the OS provides 'file reference URLs' which are much like FSRefs. See: Good to know. I'm very interested in your experience relat

Re: Hash Values in Custom Classes

2011-03-28 Thread Peter Lübke
To be more detailed: my custom class and its subclasses are wrapper classes containing file informations. They are based on FSRef rather than using paths - I do a lot of lengthy iterations so paths are much too fragile. I also heavily use NSSet to store instances, and I wanted -isEqual: t

Re: Hash Values in Custom Classes

2011-03-27 Thread Peter Lübke
If not, about the only optimization from there is a NSHashTable or CFSet setup to test equality on -hash. Could you point me to a documentation that could help me understand NSHashTable? Badly expressed - I meant documentation / sample code about how to use an NSHashTable for such an op

Re: Hash Values in Custom Classes

2011-03-27 Thread Peter Lübke
Am 26.03.2011 um 14:57 schrieb Mike Abdullah: To be more detailed: my custom class and its subclasses are wrapper classes containing file informations. They are based on FSRef rather than using paths - I do a lot of lengthy iterations so paths are much too fragile. I also heavily use NSSe

Re: copyPath:toPath:handler: more reliable than copyItemAtPath:toPath:error: ???

2011-03-27 Thread Peter Lübke
Am 26.03.2011 um 16:41 schrieb Matt Neuburg: On Fri, 25 Mar 2011 12:08:53 -0700, Laurent Daudelin said: I've been trying to copy items from a local disk to an AFP-mounted volume with "copyItemAtPath:toPath:error:" and I found it to be unreliable in the sense that it will fail to set the

Re: Hash Values in Custom Classes

2011-03-25 Thread Peter Lübke
Thank you, Mike, for showing me I was taken away by my own fantasy about hash... Am 26.03.2011 um 01:22 schrieb Mike Abdullah: It sounds like you're rather misunderstanding what -hash does. Cocoa classes are free to cover the full range of possible hash values. In the meantime, I read so

Hash Values in Custom Classes

2011-03-25 Thread Peter Lübke
Hi, I'm wondering if there exists a listing of the hash values used by the various Cocoa / CoreFoundation classes. I override -isEqual in my custom classes and want to make sure I don't assign hash values that interfere with the framework(s). Thanks, Peter _

Re: iPhone: NSFileManager/NSDirectoryEnumerator Crash?

2011-03-11 Thread Peter Lübke
What about your "files" collection? Are you sure it is still valid AND mutable on the second invocation? Peter NSString* directory = nil; NSFileManager* fileManager = nil; NSDirectoryEnumerator* walker = nil directory = [NSHomeDirectory() stringByAppendingPathComponent:@"Docum

Re: WindowID to front

2011-02-28 Thread Peter Lübke
Am 28.02.2011 um 16:55 schrieb Benedikt Iltisberger: Hey Peter, you are right. AXUIElementPerformAction(windowElement, kAXIncrementAction); Has no effect. I also recognized that the AXRaise seems to be not exactly what i wanted. If I raise a window for the first time it works fine. If I ra

Re: WindowID to front

2011-02-28 Thread Peter Lübke
Am 28.02.2011 um 15:10 schrieb Benedikt Iltisberger: Hey Peter, I did it exactly like you proposed. Works perfect :-) I am using following calls to make a selected window front most: AXUIElementPerformAction(windowElement, kAXRaiseAction); This should be sufficient to bring the window to fr

Re: WindowID to front

2011-02-28 Thread Peter Lübke
Uli, I apologize for my silly comment. Of course you are absolutely right. I totally overlooked you were refering to a User Session window ID, which is totally different from an application specific window ID. Cheers, Peter Am 28.02.2011 um 11:19 schrieb Peter Lübke: There's no pr

Re: WindowID to front

2011-02-28 Thread Peter Lübke
tep to the equivalent AXUIElementRef, which I need to have in order to set the AXRaise? Sorry for bothering you like that but I guess this is also an interesting issue for other users. Your'e welcome... Cheers, Benedikt On 28.02.2011, at 11:19, Peter Lübke wrote: There's no proble

Re: WindowID to front

2011-02-28 Thread Peter Lübke
There's no problem accessing a window by its (application specific!) ID by AppleEvents / AppleScript. (Must have been decades since you last opened Script Editor, Uli :-) ). Of course this depends on the application supporting AppleEvents... Just run this script in Script Editor: tell applicat

Re: WindowID to front

2011-02-28 Thread Peter Lübke
Hi Benedikt, this is Interapplication Communication, so it seems it's time for you to get into AppleEvents:-) Send an AppleEvent to the other app to set the window's index to 1 (indexes in AppleEvents are 1-based!). Cheers, Peter p.s.: Schöne Grüße aus München Am 27.02.2011 um 13:55 sc

Re: NSWindowController

2011-02-27 Thread Peter Lübke
BTW, is there a particular reason why you retain m_designViewerController ? A newly allocated object *is* a retained object. It will need one extra entire line of code to send a -release message to the object for it not to leak :-) -Peter Am 26.02.2011 um 09:08 schrieb koko: 1 m_designV

Re: Getting NSScrollView to ignore scrolling

2011-02-19 Thread Peter Lübke
HI All, I have a NSTableView/NSScrollView setup that I've configured automatically to resize to contain the content of the table. This may sound silly, but I don't want scrolling behavior, but NSTableView seems to be designed to be inside a NSScrollView. My question is this: how do I get

Re: NSComboxBox alternative

2011-02-17 Thread Peter Lübke
What about NSTableView? Just one column with a pretty large width... - Peter Am 17.02.2011 um 20:41 schrieb FirstName LastName: I have a selectable non-editable NSComboBox for choosing paths. However some of these paths are larger than the NSComboBox's width causing the following prob

Re: Get ProcessSerialNumber of last front application

2011-02-09 Thread Peter Lübke
GetNextProcess() doesn't reflect the order in which processes were made front, as the Process Manager doc says: "Note that the order of the list of processes is internal to the Process Manager" which *seems* to be the order in which processes register with Process Manager; if this is true (

Re: worker thread iterating over array - SLOW

2011-02-01 Thread Peter Lübke
Peter Am 01.02.2011 um 05:45 schrieb Ken Thomases: On Jan 31, 2011, at 8:48 PM, Peter Lübke wrote: Thanks Ken, You're welcome. Am 01.02.2011 um 02:07 schrieb Ken Thomases: So, you have effectively failed to shift the work from the main thread to the worker thread. The main thread is

Re: worker thread iterating over array - SLOW

2011-01-31 Thread Peter Lübke
Thanks Ken, I was afraid to get an answer like this:-) Am 01.02.2011 um 02:07 schrieb Ken Thomases: On Jan 31, 2011, at 5:13 PM, Peter Lübke wrote: I use a worker thread in my app that invokes the same method(s) on all objects in an array sent from the main thread. The array may contain

Re: worker thread iterating over array - SLOW

2011-01-31 Thread Peter Lübke
Am 01.02.2011 um 00:20 schrieb A.M.: On Jan 31, 2011, at 6:13 PM, Peter Lübke wrote: Hi list, I use a worker thread in my app that invokes the same method(s) on all objects in an array sent from the main thread. The array may contain thousands of objects. The main thread communicates

worker thread iterating over array - SLOW

2011-01-31 Thread Peter Lübke
Hi list, I use a worker thread in my app that invokes the same method(s) on all objects in an array sent from the main thread. The array may contain thousands of objects. The main thread communicates with the worker thread via distributed objects. Everything works fine except performance

Re: copyItemAtPath takes double time than the Finder

2011-01-19 Thread Peter Lübke
Why not have the Finder do the job? You can use AppleEvents to send a duplicate message to the Finder; you can do it sync (kAEWaitReply) or async (kAENoReply). Behaviour and performance will be the same as using the Finder, including proper update of .DS_Store files. Am 20.01.2011 um 00:49

Re: Odd Crash when adding table columns manually

2011-01-11 Thread Peter Lübke
Table columns are retained by the table view they are added to. So you can safely release or autorelease the table column right after invoking -addTableColumn: . The table view owns its columns and will release them when it itself is released. This is the normal behaviour when adding subvie

Re: Change the NSPreferencePane window size programmatically

2011-01-07 Thread Peter Lübke
Whatever you do to an app that isn't yours: use the APIs supplied for Interapplication Communication, as there are (among others): AppleEvents, AppleScript, Accessibility... These ensure sufficient isolation between the objects involved, and they are (to a certain extend) likely to survive t

Re: Close System Preferences programmatically

2011-01-04 Thread Peter Lübke
Am 04.01.2011 um 23:38 schrieb eveningnick eveningnick: - If you really want System Preferences to quit, you could use NSAppleScript and do something like: tell application "System Preferences" to quit You can do the same using AppleEvents. Peter, could you hint me on how to do it using App

Re: Close System Preferences programmatically

2011-01-04 Thread Peter Lübke
Though almost everybody seems to disagree you should do something like this here some ideas: - If you want to press the "Show All"- or "Back"- button, you could do this using the Accessibility API; take a look at Apple's "Accessibility Inspector" app. - If you really want System Preferenc

Re: Event to trigger writeSelectionToPasteboard

2011-01-01 Thread Peter Lübke
You can copy a selection using the Accessibility API: First get the UIElement for the application's "Copy" menu item. Then invoke "AXPress" on it. Drawback is that you will have to ask the user to enable Accessibility if it is not enabled. To get an idea about Accessibility, look at Apple's "A

Re: XML to Plist

2010-12-28 Thread Peter Lübke
Hi Sandro, just to mention it (this has nothing to do with your original question): Why don't you create your NSMutableDictionary with [NSMutableDictionary dictionary] ? This produces exactly the same result as [[[NSMutableDictionary alloc] init] autorelease] - practically all Cocoa CLASS met