Re: [NSMutableData resetDataRangeTo:(NSRange)range];

2014-07-12 Thread Matt Gough
don’t you just want: [bigData replaceBytesInRange:NSMakeRange(0, 1024) withBytes:NULL length:0]; ?? I am sure NSMutableData is well optimized for shunting its contents around internally. Matt On 12 Jul 2014, at 20:36, Carl Hoefs newsli...@autonomy.caltech.edu wrote: Basically what I would

Re: Disabling screen capture

2014-02-22 Thread Matt Gough
OK, So lets assume that you can’t actually prevent the screen being captured. Maybe a solution would be to prevent that captured data from surviving very long. e.g Install an FSEvents watcher and look out for image and movie files being created on the entire disk. Then delete them while your

Re: Thread Deadlock

2012-05-16 Thread Matt Gough
Graham, I have seen similar hangs in other apps while trying to access recent items menu. On my Mac I put it down to occasional disk freezing issues quite common on the model of disk I am using, but maybe its software related after all. Matt On 15 May 2012, at 00:44, Graham Cox wrote: Hi

Re: Finder Integration

2011-09-30 Thread Matt Gough
Damon, Firstly there is no official way to do this, all the solutions you see in the wild are hacks of one sort or another. Having said that, I had to implement what you are asking for (overlays on icons) and did it via SIMBL. Unfortunately I can't share code or say too much about what what

Re: question about identifying old apps

2011-09-16 Thread Matt Gough
They should have a File type of 'APPL'. (There are a few other file types that are also used for applications, but I can't remember them off hand.) Or you can get launch services to let you know if its an app or not. See LSInfo. Matt On 16 Sep 2011, at 12:14, Rick C. wrote: Hi, This

Re: Distributed Notification observing change in Lion?

2011-09-08 Thread Matt Gough
Thanks, that was exactly the problem Matt On 7 Sep 2011, at 17:38, Ben Gollmer wrote: On Sep 7, 2011, at 11:48 AM, Matt Gough wrote: I have an observer for a Dist notification in my app. In Lion, my observer doesn't actually get called until I interact with my app in some way (i.e show

Distributed Notification observing change in Lion?

2011-09-07 Thread Matt Gough
I have an observer for a Dist notification in my app. In Lion, my observer doesn't actually get called until I interact with my app in some way (i.e show a menu, or click on a window). Until I do that it doesn't get delivered. I have checked that the notification gets posted when I expect it

Re: getting last accessed date

2011-07-14 Thread Matt Gough
But on the FSPathMakeRef line I keep getting the warning that pointer targets in passing argument 1 of 'FSPathMakeRef' differ in signedness. Would someone mind telling me why I'm getting this error? Thanks you very much! Because FSPathMakeRef takes a UInt8* as its first parameter, while

Re: finder eject images

2011-07-06 Thread Matt Gough
As everyone else has been saying, NSWorkspace image for type/file APIs and +[NSImage imageNamed:] are the API, and if it isn't there, you can file a bug but should use your own artwork. (As it says in the NSImage header.) Even if it isn't available via imageNamed, you might still be able to

Runloop not being stopped by CFRunLoopStop?

2011-07-04 Thread Matt Gough
I have a runloop running in an NSThread. In this thread is a timer which fires every 2 seconds. In the timer, I check [NSThread isCancelled] and if so, stop the runloop via CFRunLoopStop. The runloop is run via runUntilDate:distantFuture. Shouldn't runUntilDate terminate once CFRunLoopStop has

Re: Runloop not being stopped by CFRunLoopStop?

2011-07-04 Thread Matt Gough
sources as needed to process requests targeted at the receiver’s thread. Those sources could therefore prevent the run loop from exiting. -Jeff On Jul 4, 2011, at 11:36 AM, Matt Gough wrote: I have a runloop running in an NSThread. In this thread is a timer which fires every 2 seconds

Re: Automatically mirroring folders

2011-06-20 Thread Matt Gough
Can you not make use of: kFSEventStreamCreateFlagIgnoreSelf Ignore events generated by this client. For example, an application might want to watch for changes to a file so that it can reread it, but should not needlessly reread it if the change to the file was caused by the application itself

Pre 10.6 version of ComplexBrowser sample?

2011-06-14 Thread Matt Gough
Does anyone know where I can find the previous version of the ComplexBrowser example NSBrowser code? The current version is here: http://developer.apple.com/library/mac/#samplecode/ComplexBrowser/History/History.html But I want to look at the version for Mac OS X 10.5 Looking through the

Using WebKit for UI instead of Cocoa in cross-platform app

2011-05-23 Thread Matt Gough
There is some discussion that our cross-platform app should switch to using WebKit for its UI (using embedded HTML/CSS/JavaScript), instead of the current divergent code paths of Cocoa on Mac and native Windows stuff on PC. Our app doesn't have much UI. Just a few configuration panels and error

Re: How to store main window frame to user defaults?

2011-04-28 Thread Matt Gough
How about calling just calling [NSWindow setFrameAutosaveName:@YourAutosaveName] during awakeFromNib? Matt On 28 Apr 2011, at 11:32, Vyacheslav Karamov wrote: I can't use Interface builder, because it crashes while opening NIB file. I'm currently using XCode 3.2.6, but NIB file was created

Debugging a sleepless Mac

2011-03-16 Thread Matt Gough
I've just been adding code to support NSWorkspaceWillSleepNotification. Having lowered my Computer sleep time right down and left the Mac untouched for several minutes, my code never fires and the Mac doesn't actually go to sleep. Even without my app running and leaving the Mac for several

Re: Debugging a sleepless Mac

2011-03-16 Thread Matt Gough
On 16 Mar 2011, at 15:32, Kyle Sluder wrote: On Wed, Mar 16, 2011 at 5:37 AM, Matt Gough mgo...@humyo.com wrote: So it seems that something else is preventing idle sleep, but I've no idea how to find the culprit. Is there some defaults setting I can use that will log what the OS wants

Re: How to find unencoded characters

2011-03-01 Thread Matt Gough
But as the font name LastResort is nowhere documented (or is it?), Apple is free to change it to LionsLastResort this summer. http://developer.apple.com/fonts/LastResortFont/ I doubt they'd rename it, seems they just extend it as necessary:

Re: Looking for help scanning entire drives

2011-02-23 Thread Matt Gough
I wonder if your memory issues are related to autorelease issues when using [NSDirectoryEnumerator nextObject:] If you are using enumeratorAtPath, I suggest doing you loop like this (from http://www.cocoadev.com/index.pl?NSDirectoryEnumerator): NSDirectoryEnumerator *enumerator =

Re: Home-brewed code is 100X faster than -[NSScanner scanDecimal:] ??

2011-02-03 Thread Matt Gough
need NSDecimalNumber support? Seems that doubles are fine for your needs. Matt Gough On 3 Feb 2011, at 16:35, Jerry Krinock wrote: -[NSScanner scanDecimal:] takes an average of 4 milliseconds to scan a short string of decimal digits, which means tens of seconds for thousands of scans

Re: NSNotFound

2011-01-18 Thread Matt Gough
And as a side note, NSNotFound != kCFNotFound. This has caught me out a couple of times in code that is dealing with both NS and CF objects. Matt On 18 Jan 2011, at 04:58:06, Uli Kusterer wrote: On 17.01.2011, at 19:50, Quincey Morris wrote: In a slightly larger, conceptual sense, this means

Re: NSFileWrapper serializedRepresentation bloat?

2011-01-10 Thread Matt Gough
Not sure its related, but I have noticed that using Finder nowadays to create an alias of a plain folder results in a 1MB alias file. Seems its also stashing away a copy of the plain folder icon. (Actually it is stashing two copies, one in the resource fork for compatibility and one in the data

Re: iOS when is my app launched

2010-12-08 Thread Matt Gough
OK, but please consider providing the user the ability to tap the screen to skip the splash screen[s]. (e.g See Angry Birds) Matt On 8 Dec 2010, at 15:50:45, Jason Bobier wrote: Hi Glenn, This is for a game, which is an exception to this rule. Jason On Dec 8, 2010, at 9:27 AM, glenn

Re: Partially opaque window with opaque views

2010-10-05 Thread Matt Gough
Yes, but you should leave the window's alpha at 1.0. Off top of my head, it goes something like this: Create a subclass of NSView and set that class as the class for the contentView of the window (in IB) Change that class's drawRect to : - (void)drawRect:(NSRect)rect { // Clear the

Re: Checking for nil-return

2010-10-05 Thread Matt Gough
On 5 Oct 2010, at 15:18:06, Remco Poelstra wrote: Op 5-10-2010 16:11, Dave DeLong schreef: Then you have much bigger problems. I already thought so :). But I noticed that [NSArray arrayWithCapacity] also never returns nil. But I can create a very large array, and I can make it bigger

Elapsed time vs sleep

2010-07-26 Thread Matt Gough
I need to calculate (with an accuracy of 0.1 of a second) a real-time time interval. This interval should: 1. Not be affected by whether the system has been put to sleep and woken up while timing. (i.e If I start the timer then sleep the Mac for an hour and wake it up again, my interval should

Re: NSCalendar date calculation anomaly

2010-04-28 Thread Matt Gough
On 28 Apr 2010, at 15:37:59, Scott Ribe wrote: On Apr 28, 2010, at 1:04 AM, Kubernan wrote: Did you try to use NSDateComponents for building your reference date (2001/01/01) such as : No, reasonable idea though. But even better, I should have been logging the reference date after I

Re: How to empty the Trash programmatically?

2010-04-16 Thread Matt Gough
On 16 Apr 2010, at 09:46:27, Jeremy Pereira wrote: On 16 Apr 2010, at 08:22, Graham Cox wrote: Don't. The only app that the user wants to empty the trash is Finder, not yours. If they want it emptied (or emptied securely), they'll go to the Finder and use the menu there. It's OK for

Re: How does Finder determine when a file is busy being written to the disk?

2010-04-08 Thread Matt Gough
FYI, kMagicBusyCreationDate is 8:34:56am on 14th Feb 1946 (GMT). When copying an entire folder, it only sets the top-level folder's creation time to this, not all the sub-items. I suspect, but haven't tested, that anything going through FSCopyObject will exhibit the same behaviour. Matt

Re: Determining an inter-application drag source

2010-03-26 Thread Matt Gough
) But as Steve said, why should it matter? Matt Gough On 25 Mar 2010, at 23:22:54, Steve Christensen wrote: I'm curious why you need to know where the drag originated since it generally shouldn't matter. Do you have to do some extra work in one case? And what happens if you see a drag from another

Re: NSPropertyListSerialization error with apparently OK data

2010-02-18 Thread Matt Gough
Don't know, but maybe 'id' is reserved. I seem to recall a similar issue with archiving strings that were NULL or nil or something. Matt On 18 Feb 2010, at 11:25:10, Graham Cox wrote: I have a structure I'm trying to write as an xml plist. The structure is an array of dictionaries, each

Re: Main menu missing in 10.5. There in 10.6

2010-02-05 Thread Matt Gough
On 5 Feb 2010, at 09:49:19, Stefan Wolfrum wrote: Feb 5 10:45:52 Tigger Twunes[74359]: SetMenuItemHierarchicalMenu() failed with error -50 That is paramErr (in MacErrors.h). Basically you passed an invalid parameter into SetMenuItemHierarchicalMenu Matt

Breaking on 'autoreleased with no pool in place - just leaking'

2010-02-02 Thread Matt Gough
What symbol should I put a break point on to track down which part of my code is responsible for trying to autorelease without a pool in place. i.e, what prints out the __NSAutoreleaseNoPool(): Object 0xc74bc0 of class NSCFString autoreleased with no pool in place - just leaking messages. I

Re: FSEventStreamCreate and File System Events Wierdness

2010-01-29 Thread Matt Gough
Are you checking that that first event doesn't have the kFSEventStreamEventFlagHistoryDone flag set? Matt On 29 Jan 2010, at 12:22:38, Chris Idou wrote: It seems like if you pass an explicit event id into FSEventStreamCreate in absolutely insists on giving you an immediate callback that

Re: NSDrawNinePartImage autorelease problem

2010-01-19 Thread Matt Gough
On 19 Jan 2010, at 09:51:36, Richard wrote: OS Version: Mac OS X 10.5.7 (9J61) Maybe he's the only one still using 10.5.7 and some bug that was fixed in 10.5.8 is causing it. Just a thought Matt Gough___ Cocoa-dev mailing list

NSImage support for Windows ico files in 10.4.x?

2009-12-17 Thread Matt Gough
Unfortunately I don't have a 10.4.x capable Mac to try this on myself, so can someone please confirm that NSImage will be able to make use of Windows ico format icons in 10.4.x. Thanks Matt Gough___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Re: My try/catch block isn't catching exceptions on 10.6

2009-11-27 Thread Matt Gough
On 27 Nov 2009, at 01:08:28, Graham Cox wrote: Does Objective C support multiple catch blocks, like C++? In other words you could do: @try { ... } @catch( NSException* e) { // deal with NSException } @catch(...) { // deal with any other sort of exception } The equivalent in

Re: Creation date of Feb 14th 1946 - Why?

2009-11-17 Thread Matt Gough
Try duplicating a large file in Finder and do Get Info while it is copying. Matt On 16 Nov 2009, at 18:20:57, Knut Lorenzen wrote: Am 16.11.2009 um 18:16 schrieb Matt Gough: Can someone let me know if there is something magical about a file having its creation date set to: 1946-02

Creation date of Feb 14th 1946 - Why?

2009-11-16 Thread Matt Gough
Can someone let me know if there is something magical about a file having its creation date set to: 1946-02-14 08:34:56 + I am guessing it is a special flag used by Finder to let it know that a file is busy (since even after a restart a file with such a creation date is shown dimmed) Am I

[__NSFastEnumerationEnumerator nextObject] unexpectedly not very fast!

2009-09-23 Thread Matt Gough
thing as to get the description of the array each time around. Any clues? Matt Gough BTW - OS X 10.6.1 ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators

Re: [Q] NSObject's poseAsClass - Replacement?

2009-03-06 Thread matt . gough
On 5 Mar 2009, at 21:00, Eric Gorr wrote: I have a need to use poseAsClass, but I see that it has been deprecated in 10.5 and won't be available for 64-bit applications. and then you said: I am working on a Carbon - Cocoa conversion. In the carbon part, the cursor is being set to a

Re: Odd crash-loading AppleScripts

2009-03-05 Thread Matt Gough
Reza, I suspect this is not your fault. I suggest you file a radar bug. BTW - You never release NSAppleScript *script, so this code would leak. and your spelling is as bad as ever :) 'laodRunScript' Matt On 5 Mar 2009, at 11:25, Reza Farhad wrote: Has Thanks for your suggestion but it

Re: Odd crash-loading AppleScripts

2009-03-05 Thread matt . gough
In fact, even this simpler version will trip up GuardMalloc -( void ) laodRunScript { NSDictionary*errors = nil; NSString*fieldContent = @Could not Load Script, See Logs; NSAppleScript *script = [[ NSAppleScript alloc ] initWithSource:@return \Hello

Re: Getting better compression

2009-02-16 Thread matt . gough
I just looked and it is there. Open that page and search for -6. Matt On 16 Feb 2009, at 11:53, Graham Cox wrote: I did look there first thing. I don't see that option or that text. http://developer.apple.com/documentation/Darwin/Reference/ManPages/man1/zip.1.html --Graham

Re: isNotEqualToString

2009-02-13 Thread matt . gough
On 13 Feb 2009, at 10:00, Chunk 1978 wrote: -=-=-=- if ((![currentDesktopBackgroundImage isEqualToString:firstPath]) || (![currentDesktopBackgroundImage isEqualToString:secondPath])) { //Go South } lets assume that

Re: How to draw text with fade out effect?

2009-01-29 Thread matt . gough
gave up trying to accomplish the same thing over a background that was not under the control of the text drawing code. Another option is just to use a straight clip, instead of fade or truncate. If you resize Mail's Size column you will see that this is what it does. Matt Gough

Re: NSLevelIndicator Rating with half stars

2009-01-29 Thread Matt Gough
On 29 Jan 2009, at 11:13, Stefano Pigozzi wrote: Hello, Is there a way to display half ratings with NSLevelIndicator? For example having a rating of 4.5 would correspond to 4 stars and a half. It would be cool because I have to display some ratings on a scale from 0 to 10. Not tried

Re: autorelease problem

2009-01-26 Thread Matt Gough
On 26 Jan 2009, at 18:12, Nick Rogers wrote: - (NSString*)suggestedRepeatFileName:(NSString *)fileName inDir: (HDIR *)dir { // some code here NSString *fileNameReturned = [NSString stringWithFormat:@%@, someString]; return fileNameReturned; } Is there any problem with the

Adjusting cursor in non-key Panel window

2009-01-21 Thread Matt Gough
I have an NSButton subclass which sets the cursor to the pointingHandCursor whenever the mouse is over it. This button is in an NSPanel (Utility-styled). @implementation PointingHandButton -(void)resetCursorRects { [self addCursorRect:[self bounds] cursor:[NSCursor pointingHandCursor]];

Observing [NSWindow orderOut:] ?

2009-01-21 Thread Matt Gough
hides. Thanks Matt Gough ___ 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

Re: Crash trying to create Webarchive

2009-01-20 Thread Matt Gough
On 20 Jan 2009, at 09:10, Reza Farhad wrote: The Problem is that the exception is occurring within the Apple call, so there is no way for me to break into it. Also I have tried to catch it locally but it get propagated to uncaught exceptions. Reza Break on objc_exception_throw.

Re: Dealing with exceptions in a drawing stack

2009-01-16 Thread matt . gough
On 16 Jan 2009, at 10:33, kyle.slu...@gmail.com wrote: What are you doing that could throw an exception? After all, exceptions are used to indicate programmer error, and are expensive to throw. Something tells me that you shouldn't be worrying about exceptions in your drawing code to begin

Re: NSMutableArray comparator; sorting on insert

2009-01-16 Thread Matt Gough
*)sortedArrayUsingFunction: context: hint: and - (NSData *)sortedArrayHint Matt Gough ___ 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: Getting the network Machine Icon

2009-01-12 Thread matt . gough
ask the same question on Carbon-Dev. At least one Finder engineer hangs out there. Matt Gough ___ 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

Re: More - Safari Download Security Alerts

2008-12-17 Thread Matt Gough
the Allow Relocation checkbox 5. Build and Run That's it My guess is that for Step 3, you just had /Applications. That's what I had the first time I tried it and everything did indeed get put directly in /Applications. Hope that helps Matt Gough

Re: More - Safari Download Security Alerts

2008-12-16 Thread Matt Gough
On 16 Dec 2008, at 15:25, Dave wrote: In response to this I was advised to use PackageMaker in order to create an Installer, which would in turn suppress the Security dialogs. So I built an installer but I can't get it to install the folder containing file, so far I have only managed to

Re: More - Safari Download Security Alerts

2008-12-16 Thread matt . gough
On 16 Dec 2008, at 13:54, Dave wrote: I don't install files into that folder, my application writes files to that location (by default, the user can change it) once installed. From the above document: It is important to remember that the user domain (/Users) is intended for files created

Re: Design for showing ridiculously huge number of images in Table View

2008-12-12 Thread Matt Gough
at all. I know spotlight is working OK as Finder's 'All Images' smart search finds more than 1. Might try debugging if I have time, but wondered if you had any clues? Matt Gough ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do

Re: Change Color Of Appended NSString?

2008-12-12 Thread matt . gough
On 12 Dec 2008, at 14:10, Chunk 1978 wrote: i have an NSMenuItem who's title changes programtically. how can i change the color of the appended string? -=-=-=-=- NSString *appendedTimeRemaining = [NSString stringWithFormat:@%d Hours, [self timeMenuSelection]]; [appendedTimeRemaining

Re: Programmatically constructing list of variable arguments?

2008-12-12 Thread matt . gough
On 12 Dec 2008, at 15:41, Jonathan del Strother wrote: Which works fine, but rapidly expands into a huge if-statement as you try and handle more states. Ideally I'd like to do something along the lines of: NSMutableArray* ingredients = [NSMutableArray arrayWithObjects:@gin, @vodka, nil]; if

Re: Design for showing ridiculously huge number of images in Table View

2008-12-12 Thread Matt Gough
On 12 Dec 2008, at 17:32, Corbin Dunn wrote: There are some sample images with it to ensure Spotlight had something specific do index. If you search for Flower or Corbin does it ever give anything back? One thing to check is to see if you have any excluded directories in Spotlight prefs.

Re: Searchable persistent file reference

2008-12-10 Thread matt . gough
On 10 Dec 2008, at 14:59, Ben wrote: I am trying to store a reference to a file in a database, such that if the file moves, I can still search for it in my database. I have read up on the Carbon Alias Manager and the third party BSAlias/NDAlias classes but none of these quite seem to fit

Re: Can I split an implementation file?

2008-11-27 Thread Matt Gough
Yes, something like this should do you In file MyObj.h @interface MyObj : NSObject{ Foo* _foo; } -(Foo) foo; -(void) setFoo:(Foo)aFoo; -(void) solveWorldFinancialCrisis; @end; In file MyObj+GetSetters.m: #import MyObj.h @implementation MyObj (GetSetters) -(Foo) foo {} -(void)

Re: Testing apps on 10.*

2008-11-25 Thread matt . gough
No, it won't run any versions prior to 10.5. Matt Gough On 25 Nov 2008, at 17:22, Nick Zitzmann wrote: Coming from windows development, there you can test your apps using VMware on a different flavor of windows. How is this achieved on the Mac? Well, if you have the budget to buy old

Re: IKImageBrowserView with NSArrayController bindings

2008-11-13 Thread Matt Gough
in it. It would be expecting other parameters to fill in the details. The usual and simpler version would be: NSLog(@%@, [arrayController selectionIndexes]); (The %@ get replaced by the result of the supplied object's description method) Matt Gough

Re: Finding out that a volume is going away before it does

2008-10-27 Thread matt . gough
/ kEventVolumeUnmounted carbon events would do what you need. This will tell you the cRefNum of the unmounted volume (once again though after it had gone). Matt Gough * kEventClassVolume / kEventVolumeUnmounted * * Summary: *An existing volume has been unmounted (or media ejected

Re: Finding out that a volume is going away before it does

2008-10-27 Thread matt . gough
On 27 Oct 2008, at 12:30, Gregory Weston wrote: The documentation you attached included a caveat that the volume reference number I'd receive isn't useful for anything except comparison against cached data. Can't use FSGetVolumeInfo. The assumption being that you already have a cache of

Re: __memcpy crash with [NSData -getBytes:range:]

2008-10-10 Thread Matt Gough
On 10 Oct 2008, at 11:48, Daniel Kennett wrote: // Allocate a buffer. void *buffer = malloc(length); // Fill the buffer with the requested bytes. [_data getBytes:buffer range:NSMakeRange(streamPosition, length)]; Are you sure that buffer has actually been created? Maybe you are

Re: Files without an extension

2008-09-30 Thread matt . gough
On 30 Sep 2008, at 08:07, Chris Idou wrote: Does anyone know how OS-X and/or the Finder treats files without an extension? If I have a plain text file without an extension, then changing the program that opens txt files will make it change for plain text files without an extension.

Re: Mixing ObjC and C++ STL on same ObjC source file

2008-09-12 Thread matt . gough
On 12 Sep 2008, at 10:17, Daniel Luis dos Santos wrote: Hello ! I have an objective C class and want to call a method on a class in C ++. As argument to the C++ class is a map instance of the STL. The ObjC class definition is on a file with a mm extension. I have std::map *var as a member

Re: webDAV (lite) framework?

2008-07-22 Thread Matt Gough
On 22 Jul 2008, at 4:50pm, em wrote: And by the way, do you always answer a question with another question? Isn't that bizarre? I don't know; is it? (Sorry couldn't resist :) ) Matt ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please

Re: Concurrent network transmission

2008-07-17 Thread Matt Gough
On 17 Jul 2008, at 1:41pm, em wrote: Every computer that Apple sells contains both fire-wire as well as built-in Ethernet. Is there any generally re-useable technique (API?) for utilizing TCP/IP over both the built-in Ethernet connection as well as 'TCP-IP over firewire' for high-speed

Re: NSBezierPath fill pattern?

2008-07-14 Thread Matt Gough
Sounds like you want to use [NSColor colorWithPatternImage] and use that as the fill color. Matt On 14 Jul 2008, at 4:48pm, David Harper wrote: Hello, I'm hoping to find a way to fill an NSBezierPath with a bitmap pattern of arbitrary size - probably something like 32x32. It will be a

Re: Receive notifications about frontmost application change

2008-07-10 Thread matt . gough
On 10 Jul 2008, at 5:16pm, Matt Neuburg wrote: Copy and paste is pretty easy: http://www.cocoabuilder.com/archive/message/cocoa/2006/2/4/156003 EventHandlerUPP handlerUPP = NewEventHandlerUPP(appSwitched); InstallApplicationEventHandler (handlerUPP, 1, eventType, self, NULL);

Re: Receive notifications about frontmost application change

2008-07-09 Thread Matt Gough
You can do this (and a lot of other stuff not covered by NSWorkspace ) with a CarbonEvent handler on kEventClassApplication, kEventAppFrontSwitched. Matt On 9 Jul 2008, at 5:44pm, Jens Alfke wrote: On 9 Jul '08, at 3:22 AM, Александр Даровских wrote: Hi, Is there any way to subscribe to

Re: controlling system muting ?

2008-07-08 Thread matt . gough
On 8 Jul 2008, at 6:24am, Phil wrote: However, I would urge you not to mess around with the user's volume control, even you think it is an emergency---the user may feel very differently. Your application should play an alert sound, and trust that the user's system output volume and alert

Re: Calculating accurate bounds of stroked paths

2008-07-08 Thread Matt Gough
Graham, I know this issue has cropped up before (probably on the Quartz list). Have your searched its archives? A simple answer to this sort of question involves painting the path into a bitmap and hunting for the boundary Matt On 8 Jul 2008, at 2:16pm, Graham Cox wrote: I need to know

Re: NSString uppercaseString

2008-06-27 Thread matt . gough
On 27 Jun 2008, at 3:30pm, Uli Kusterer wrote: If you read the documentation closely, you'll see that it would be perfectly valid to implement this method so the string goes away when the original (non-uppercase) string is released. Hmmm, not sure I'd read it that way (depending on what

Re: A simple doubt about array

2008-06-11 Thread Matt Gough
On 11 Jun 2008, at 03:09, Jens Alfke wrote: That way you won't run into the issue that NSArray objects can't contain empty (nil) elements... Another thing that is often overlooked by Cocoa newbies is that you can add NSNull to NSArray objects (and other collection objects) e.g MyObj*

Re: Link to zlib

2008-06-11 Thread matt . gough
flags' in the target. For libzlib, you would use -lz I think the reason for this is to avoid hard-coded dependancies on a particular version of the library. Matt Gough P.S - Yes, this should really be on the xcode list, not here. ___ Cocoa-dev

Re: Where are window prefs stored?

2008-06-10 Thread Matt Gough
10 Jun 2008, at 11:21, Ken Tozier wrote: Hi My app opens several palettes and uses the following line to store the palette positions [[self window] setFrameAutosaveName: @palette name here]; I ran into a problem with the stored size and want to flush the old prefs and start over. Where

Re: Spotlight sources w/o actual files?

2008-06-10 Thread matt . gough
history. Matt Gough ___ 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

Re: NSPasteboard Delegate

2008-05-22 Thread Matt Gough
Maybe you could set up a timer to run once every second or so that checks the pasteboard's changeCount. Not sure there is an explicit notification of changes. Matt On 22 May 2008, at 14:08, Adil Saleem wrote: Actually i want my application to be notified whenever there is a new text

Re: NSPasteboard Delegate

2008-05-22 Thread matt . gough
On 22 May 2008, at 14:18, Graham Cox wrote: Do read this: file:///Developer/Documentation/DocSets/com.apple.ADC_Reference_Library.CoreReference.docset/Contents/Resources/Documents/documentation/Cocoa/Conceptual/CopyandPaste/Articles/pbFundamentals.html (by the way, does pasting the file URL

Re: NSSecureTextField and paste

2008-05-21 Thread Matt Gough
On 21 May 2008, at 15:31, Torsten Curdt wrote: So it also disabled passing values IN ...not just OUT. Why? Any idea on how to enable paste in NSSecureTextFields? From a security point of it makes some sense to prevent pasting. You don't really want people keeping plain text versions of

Re: NSSecureTextField and paste

2008-05-21 Thread Matt Gough
On 21 May 2008, at 16:05, Torsten Curdt wrote: From a security point of it makes some sense to prevent pasting. You don't really want people keeping plain text versions of their passwords around. Also, whatever was pasted would be left on the clipboard. That would be very easy for someone

Re: NSSecureTextField and paste

2008-05-21 Thread Matt Gough
On 21 May 2008, at 16:06, Torsten Curdt wrote: If the script can paste into the box and hit the OK button I assume it could also simulate key strokes ...no? No, Its my understanding that the NSSecureTextField is very particular about how it will get its input. i.e You can't use the

Re: Accessing [event modifierFlags] in an action method?

2008-05-20 Thread Matt Gough
Thanks, I knew there would be a simple way. Matt On 20 May 2008, at 14:21, Graham Cox wrote: [[NSApp currentEvent] modifierFlags]; hth, G. On 20 May 2008, at 10:16 pm, Matt Gough wrote: I have an action method for a disclosure button : -(IBAction) toggleText:(id) sender

[NSMutableParagraphStyle setTighteningFactorForTruncation:] clarification

2008-05-20 Thread matt . gough
According to the documentation: * This method accepts positive and negative values, excluding 0. The default value is 0.05. * It seems that 0 is exactly the value I want to use to ensure there is no tightening. Is the documentation wrong? Matt

Is [Red] the only special color for NSNumberFormatter?

2008-05-19 Thread matt . gough
According to http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSNumberFormatter_Class/Reference/Reference.html : An even simpler way to cause negative values to be displayed in red is to include the constant [Red] in your format string, as shown in this

Re: Efficient XML loading [continuation of NSString from mapped NSData thread]

2008-05-15 Thread Matt Gough
On 15 May 2008, at 00:20, Jens Alfke wrote: Because it would be orders of magnitude slower. Even the property list parser can read the iTunes library in a few seconds. Extracting all that information via AppleEvents would certainly take minutes. Taking that amount of time, it would be

[NSImageView setImage:nil] clarification

2008-05-15 Thread matt . gough
It isn't explicitly mentioning anywhere, but is: [someImageView setImage:nil]; the correct way to have an empty image view. Often the Appkit documentation calls out the validity of nil parameters (e.g [NSActionCell setImage:] and [NSLevelIndicator setImage:]), so the lack of such a

Re: iPhone SDK List?

2008-05-15 Thread Matt Gough
When the SDK comes out of NDA it would be nice if there were a separate list for iPhone related issues, otherwise I can imagine this list being swamped with postings that a lot of us here have no interest in (since we aren't developing iPhone apps). General questions about common APIs

Re: Efficient XML loading [continuation of NSString from mapped NSData thread]

2008-05-14 Thread Matt Gough
On 14 May 2008, at 16:52, Keith Duncan wrote: The only problem however is that iTunes periodically replaces this file, if this were to happen whilst I have the original mapped, would my app crash? Essentially, whilst I have the file open, will it remain readable? Well, if iTunes is

Re: Multiple controls in a table cell

2008-05-07 Thread matt . gough
method? I need to support 10.4 and later so alas NSCollectionView is a no-go. I assume that you have real-world code running in real software that uses SubviewTableViewCell. Have you had any issues with it that make it risky? Thanks Matt Gough

Re: Is there any compression library for Cocoa?

2008-04-30 Thread matt . gough
On 30 Apr 2008, at 12:35, Trygve Inda wrote: So why the need for + dataWithBytesNoCopy:length:freeWhenDone: ? It would seem that if freeWhenDone is YES, these are identical calls? Because sometimes you might want to use NO. i.e maybe its a non- malloced buffer that you want to treat as

Using a real view in a Table cell

2008-04-25 Thread matt . gough
to NSTableView will break this. 2. Whenever I think I am being far too cunning it usually means I have overlooked a much simpler way to do what I want. Does anyone else have any suggestions Thanks Matt Gough ___ Cocoa-dev mailing list (Cocoa-dev

Re: Resource Fork - is this a good use/the right thing to do?

2008-04-23 Thread Matt Gough
I'd second that. The OS (well, Finder) also adds things to the resource fork of files (custom icons, info about which app to open a file with when you changed it from the default etc). Just as long as you respect the existing contents this is exactly where you should put your data. On

Re: NSString format parameter order

2008-04-08 Thread matt . gough
On 8 Apr 2008, at 11:33, Jere Gmail wrote: I'm looking for a way to switch parameters order in order to use the same parameters for different languages. something like NSString string1=@you NSString string1=@hello NSString str=[NSString stringWithFormat:@%2 %1, string1,string2]; will make str

Re: How to add number do Dock Icon like in Mail?

2008-04-08 Thread matt . gough
On leopard or later, you can just do: [[[NSApplication sharedApplication] dockTile] setBadgeLabel:[[NSNumber numberWithInt:42] stringValue]]; to put 42 as a badge Matt On 8 Apr 2008, at 14:06, Adam P Jenkins wrote: See [NSApplication setApplicationIconImage: (NSImage*)]. This changes

  1   2   >