Re: Context Menu and first responder targets

2023-03-05 Thread Graham Cox via Cocoa-dev
be a good fit, look at the menu delegation protocol, which allows you to populate a menu on the fly. You can still create a placeholder in IB to get automatic pop-up behaviour. —Graham (Forgive any misinformation, I’m getting a little rusty). > On 6 Mar 2023, at 3:27 am, Eyal Redler via Co

Re: Prevent screen saver from starting, but don't prevent computer sleep

2020-06-29 Thread Graham Cox via Cocoa-dev
Then look at some of the other options in that API, e.g. IOPMAssertionDeclareUserActivity AFACS, this is the supported way to do the kinds of things you want, of it can be done at all. > On 29 Jun 2020, at 4:51 pm, Gabriel Zachmann wrote: > >> but the header for that function says it can be

Re: Prevent screen saver from starting, but don't prevent computer sleep

2020-06-28 Thread Graham Cox via Cocoa-dev
out. —Graham > On 29 Jun 2020, at 5:31 am, Gabriel Zachmann via Cocoa-dev > wrote: > > Yes, agreed. That is why I would like to disable ONLY the screensaver, > NOT System Preferences / Security / Require password ... > ___

Re: Prevent screen saver from starting, but don't prevent computer sleep

2020-06-27 Thread Graham Cox via Cocoa-dev
You can make your app trigger a command-line program and pass params using NSTask. It’s not difficult to use. But in this case you might want to negotiate this with the user - apps that just go ahead and change MY system preferences are being user-hostile to say the least. —Graham > On

Re: Launching in fullscreen gives "Funk" sound sometimes

2020-06-24 Thread Graham Cox via Cocoa-dev
Set a symbolic breakpoint on NSBeep and see whether it’s your code that’s calling it. —Graham > On 24 Jun 2020, at 7:23 pm, Gabriel Zachmann via Cocoa-dev > wrote: > > I have an app that should switch to fullscreen automatically, > if it is launched with a specific flag.

Re: Increasing stack size of NSDocument's open file thread

2017-07-06 Thread Graham Cox
ack depth in hand. So… unless someone has any bright ideas (or has even read this, very unlikely), I’ll ponder some more. —Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the

Re: Increasing stack size of NSDocument's open file thread

2017-07-06 Thread Graham Cox
n existing file correctly. The annoying thing is that it works fine 99% of the time, just hitting the stack limit on rare occasions. —Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator com

Increasing stack size of NSDocument's open file thread

2017-07-05 Thread Graham Cox
object graph is flat, so the stack limit increase only needs to be temporary during dearchiving on the background thread). —Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the

Re: Very slow NSTableView

2017-07-05 Thread Graham Cox
ourself? Interesting… I don’t know why it was set to ‘source list’, in fact the regular style doesn’t do transparency/vibrancy so it’s win-win. However, I’m converting it all to view-based anyway, which also does not seem to be hampered by such issues, even when using a pop-up button with

Re: Very slow NSTableView

2017-07-04 Thread Graham Cox
> On 5 Jul 2017, at 11:23 am, Graham Cox wrote: > > If anyone can offer a place to host the project, I’d be happy to share it, > and see whether the problem is seen by others. (I no longer have file hosting > services). Never mind - I remembered I had an Amazon S3 acco

Re: Very slow NSTableView

2017-07-04 Thread Graham Cox
:column:withCellFrame:] 6.68 s 82.2% 1.00 ms -[NSPopUpButtonCell drawWithFrame:inView:] If anyone can offer a place to host the project, I’d be happy to share it, and see whether the problem is seen by others. (I no

Re: Very slow NSTableView

2017-07-04 Thread Graham Cox
> On 4 Jul 2017, at 6:02 pm, Graham Cox wrote: > > I can live with layer-backing as a solution, it doesn’t appear to have any > downsides. I spoke too soon. Layer backing disguises the performance issue by capturing the first render pass which is then used for scrolling. So

Re: Very slow NSTableView

2017-07-04 Thread Graham Cox
> On 4 Jul 2017, at 5:39 pm, Quincey Morris > wrote: > > On Jul 4, 2017, at 00:18 , Graham Cox wrote: >> >> Is there a way to opt-out of vibrancy for an entire table view? > > There’s no clear indication that the performance problem has anything to do &

Re: Very slow NSTableView

2017-07-04 Thread Graham Cox
> On 4 Jul 2017, at 5:00 pm, Graham Cox wrote: > > >> On 4 Jul 2017, at 12:29 pm, Quincey Morris >> wrote: >> >> On Jul 3, 2017, at 18:19 , Graham Cox wrote: >>> >>> slow. as. molasses. >> >> What does Instruments say it’

Re: Very slow NSTableView

2017-07-04 Thread Graham Cox
> On 4 Jul 2017, at 12:29 pm, Quincey Morris > wrote: > > On Jul 3, 2017, at 18:19 , Graham Cox wrote: >> >> slow. as. molasses. > > What does Instruments say it’s doing? > Heh, well, I wish I knew. Instruments isn’t working. It’s a new machine whic

Very slow NSTableView

2017-07-03 Thread Graham Cox
performance issues in other views, but it hasn’t helped. —Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Re: Doubled Pixels

2017-06-25 Thread Graham Cox
> On 25 Jun 2017, at 7:39 pm, Gerriet M. Denkmann wrote: > > Which of these two lines is preferable: > NSString *colorSpaceName = useColour ? NSDeviceRGBColorSpace : > NSDeviceWhiteColorSpace; > NSString *colorSpaceName = useColour ? NSCalibratedRGBColorSpace : > NSCalibratedWhite

Re: Doubled Pixels

2017-06-24 Thread Graham Cox
> On 24 Jun 2017, at 4:46 pm, Gerriet M. Denkmann wrote: > >> By making the NSBitMapRepresentation yourself, creating a context for it, >> drawing to that. >> —Graham > > You severely underestimate the depth of my ignorance. It took me half a day > to fat

Re: Why is XCode suddenly doing this?

2017-06-23 Thread Graham Cox
understanding of what’s going on. —Graham > On 23 Jun 2017, at 10:32 pm, Mark Allan wrote: > > Graham, > > This happened to me a few months ago and it was driving me nuts until I > eventually figured out what was causing it (by trawling through all my git > commits aroun

Re: Doubled Pixels

2017-06-23 Thread Graham Cox
ode. I’ve certainly had that happen when Retina screen came out for example, and had to go back and do it using the long initializer so I got what I asked for. —Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin re

Why is XCode suddenly doing this?

2017-06-22 Thread Graham Cox
how do I get it back to working correctly? —Graham ___ 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/Unsubscr

Re: Writing NSImage

2017-06-21 Thread Graham Cox
Drop down one level - create a bitmap image rep of the type you want, make a context for it, draw the image into that, then (if necessary) add it to a NSImage with addRepresentation: Working at this level you have total control, and rarely need an NSImage at all. —Graham > On 21 Jun 2

Re: Annual codesign pain point

2017-06-18 Thread Graham Cox
, which were probably a red herring after all. —Graham > On 19 Jun 2017, at 1:58 pm, Shane Stanley wrote: > > On 19 Jun 2017, at 1:06 pm, Graham Cox wrote: >> >> resource fork, Finder information, or similar detritus not allowed > > See: <https://develope

Annual codesign pain point

2017-06-18 Thread Graham Cox
have to resolve this urgently because we must be able to sign and release our apps. —Graham ___ 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-d

Re: Getting the true rotation of a UIView layer

2017-03-14 Thread Graham Cox
just transform a known point and see where it ends up. That way you don’t need to know how the transform’s internals are laid out. > On 15 Mar 2017, at 2:41 PM, Eric E. Dolecki wrote: > > I don't follow. > > On Tue, Mar 14, 2017 at 11:29 PM Graham Cox wrote: > Get th

Re: Getting the true rotation of a UIView layer

2017-03-14 Thread Graham Cox
Get the final transform, then use it to transform an angle of 0. The result is the angle. —Graham > On 15 Mar 2017, at 2:13 PM, Eric E. Dolecki wrote: > > Once done (I dispatch after the randomSpeed duration), I'd like to > determine the angle it's c

Re: Sometimes all my menus are disabled

2017-02-14 Thread Graham Cox
st. If you prefer to swim upstream, you only have yourself to blame. No offence (and none taken). Good luck! —Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contac

Re: Sometimes all my menus are disabled

2017-02-13 Thread Graham Cox
minutes? You cannot program effectively using Cocoa without knowing how to use IB. The POINT of IB is to save you having to spend hours coding to set up simple interfaces. Someone has to point out the elephant in this particular room. —Graham ___

Re: Sometimes all my menus are disabled

2017-02-12 Thread Graham Cox
Another possibility is that the target (app delegate) overrides -validateMenuItem: and isn’t doing the right thing. —Graham > On 13 Feb 2017, at 7:55 AM, Kyle Sluder wrote: > >>> >>> On Feb 12, 2017, at 12:36 PM, Andreas Falkenhahn >>> wrote: >&g

Re: What should we do if file-opening takes a long time?

2016-12-31 Thread Graham Cox
one of these file opens going on asynchronously, you might want to consider a stacked progress design, but you have to do all that yourself. NSProgress is thread safe and might be useful for this. —Graham > On 31 Dec 2016, at 7:52 PM, Daryle Walker wrote: > > Let’s assume we’r

Re: Giving names to undo actions

2016-12-21 Thread Graham Cox
prepareWithInvocationTarget:self] setState:_state]; _state = state; } —Graham > On 21 Dec 2016, at 7:06 PM, John Brownie wrote: > > I have undo working correctly in my macOS app, but I have a question about > action names. > > The documentation tells you to set the name when registe

Re: [Solved] Crash in addSubview: when compiled with SDK > 10.9

2016-11-03 Thread Graham Cox
the correct direction. > That isn’t the correct direction. If your views don’t need view controllers, just remove them altogether. Making them NSObjects is dead weight at best, could cause further mysterious behaviour at worst. —Graham ___ Cocoa-dev

Re: observeValueForKeyPath:... called too often in macOS 12

2016-10-17 Thread Graham Cox
ode smell of your own. I wouldn’t base any critical code on the exact behaviour of a KVO notification. They’re mostly just there to update UI (and in that case even double KVO notifications shouldn’t cause double UI updates as they are coalesced anyway).

Re: Xcode 8 causes scroll issue when displaying keyboard

2016-10-11 Thread Graham Cox
it in -viewDidAppear instead? Is there no ‘initialFirstResponder’ connection there? I’m not familiar enough with iOS, but that’s the way Mac does it. —Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests o

Re: Swift 3 macOS read keyboard

2016-10-10 Thread Graham Cox
ff keyUp and keyDown from within my main >> NSViewController so I can read keys? I’m not sure what you mean by “kicking off”, which sounds like you want to post those events. If you want to receive them, just override -keyUp: and -keyDown: in your controller subclass. —Graham > On 11

Re: Cocoa-dev Digest, Vol 13, Issue 415

2016-09-29 Thread Graham Cox
or it may not, that’s a detail you don’t need to consider. If it turns out it’s really slow, and that is a problem, then worry about it. I suspect you won’t have to. —Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do n

Re: NSTextView read real text content (without 0xA added by wordwrap)

2016-09-27 Thread Graham Cox
s it came from somewhere, therefore that isn’t the ‘original’ string. Perhaps the original string has those line breaks? If it was cut+pasted from a block of text that had forced line endings, NSTextView will preserve those, but it definitely never adds them as part of its

Re: NSTextView read real text content (without 0xA added by wordwrap)

2016-09-27 Thread Graham Cox
r the word-wrap done by the view to affect the raw string, because it’s a major violation of model-controller-view principles. If something else is adding those, it must be going well out of its way to do it. —Graham ___ Cocoa-dev mailing

Re: NSTextView read real text content (without 0xA added by wordwrap)

2016-09-27 Thread Graham Cox
’ve never seen the text view add line endings to the underlying raw text - that’s just not how text layout works. (Indeed I just made a quick test case and I don’t see that happening). —Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Re: XCode documentation browser

2016-09-26 Thread Graham Cox
> On 27 Sep 2016, at 11:01 AM, Graham Cox wrote: > > the browser has started to open everything in Safari Never mind; re-downloading the doc sets has fixed it. —G. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not p

XCode documentation browser

2016-09-26 Thread Graham Cox
and not relying on the network. Just this last week, the browser has started to open everything in Safari, directly referencing online documentation. Why? How can I put it back to working the way I want it to? AFAIK, I didn’t do anything to change any settings. —Graham

Re: Subclassing and Archiving/Unarchiving

2016-09-25 Thread Graham Cox
trings) so that it can do this easily. There are also class methods for setting up class substitutions. You could also add the extra information as a subobject within the base class, and simply ignore it when dearchiving. —Graham ___ Cocoa-dev mail

Re: Stupid objective-c question

2016-09-23 Thread Graham Cox
> On 24 Sep 2016, at 12:13 PM, Uli Kusterer > wrote: > >> I expect the first thing -isEqualToString: does is a pointer comparison, so >> it’s unlikely to be significantly less performant for the case of when the >> pointers are literally identical. > > No,

Re: MLMediaLibrary sometimes does not call my KVO

2016-09-22 Thread Graham Cox
lements, which is why the problem seems to be in the lower-level layers of MLMediaLibrary. —Graham ___ 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 c

Re: Stupid objective-c question

2016-09-21 Thread Graham Cox
> On 22 Sep 2016, at 10:40 AM, Quincey Morris > wrote: > > On Sep 21, 2016, at 17:01 , Graham Cox wrote: >> >> This should be: if([(NSString*)context >> isEqualToString:@“mediaLibraryLoaded”])… > > Actually, this is not a good idea either, because *oth

Re: Stupid objective-c question

2016-09-21 Thread Graham Cox
antage of undocumented implementation details. This should be: if([(NSString*)context isEqualToString:@“mediaLibraryLoaded”])… I expect the first thing -isEqualToString: does is a pointer comparison, so it’s unlikely to be significantly less performant for the case of when the pointers are literall

Re: MLMediaLibrary sometimes does not call my KVO

2016-09-21 Thread Graham Cox
os to display), but there’s no reason it needs to hang. Hopefully 10.12 will fix the issue, but I haven’t had a chance to look into that yet. —Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or mode

Re: Package installation on MacOS Sierra

2016-09-18 Thread Graham Cox
rags the app icon to it. On 10.12, the alias appears to point to nothing, and has a generic file icon. Has this kind of installer image been obsoleted by 10.12? If so, what can we do to replace it in a way that works across various OS versions? —Graham

Re: Replacement for CGContextSelectFont ?

2016-09-18 Thread Graham Cox
s. But even if it doesn’t, it’ll still be a better option than replicating its functionality. —Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderato

Re: Replacement for CGContextSelectFont ?

2016-09-15 Thread Graham Cox
Another alternative, if you’re going to go high-level, is to use a CATextLayer. —Graham > On 16 Sep 2016, at 12:46 AM, Alex Kac wrote: > > One thing you might consider is just using an attributed string: > > NSAttributedString* attrString = [[NSAttributedString alloc] &

Re: What difference exist from where a method will be called?

2016-09-08 Thread Graham Cox
aven’t seen that there are two. A breakpoint would reveal that, because you can see the address of the object. —Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list.

Re: What difference exist from where a method will be called?

2016-09-08 Thread Graham Cox
orming surgery by posting notes through a letterbox. Open up the patient and have a proper look. —Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contac

Re: What difference exist from where a method will be called?

2016-09-08 Thread Graham Cox
clare your own ivar at all and rely on autosynthesis, and always reference the property: self.tableViewArray whenever you need to. Do one or the other, but not both. Also, as a general point, read up on model-view-controller design principles, designated initializers and cocoa naming conventions fo

Re: What difference exist from where a method will be called?

2016-09-08 Thread Graham Cox
rray will never be created. That’s probably why it’s nil in -drawRect. I don’t really understand what your ‘document protocol’ is doing, but I also notice that you craete a different array in the Document class. Wouldn’t you just want an array in one place, not two different ones? —Graham _

Re: C callbacks with NSNotificationCenter?

2016-09-07 Thread Graham Cox
’ve written should work. Have you tried it? (You might want to more strongly type your parameters though, void* is a nasty idea). —Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments t

Re: Security-scoped bookmarks, what's going on?

2016-09-06 Thread Graham Cox
or you help anyway, I have made some progress. I bloody hate the way sandboxing is implemented though, it’s just a PITA. —Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the

Security-scoped bookmarks, what's going on?

2016-09-06 Thread Graham Cox
n, error=%@", error); } } This kind of thing has always worked for me in the past, so I’m not sure why this particular case is giving me these problems. Can anyone suggest anything I’ve overlooked? —Graham ___ Cocoa-dev mailing

Re: NSUserNotificationCenter configuration mysteries

2016-08-30 Thread Graham Cox
> On 31 Aug 2016, at 10:42 AM, Graham Cox wrote: > > note.identifier = self.URL.absoluteString; > > [[NSUserNotificationCenter > defaultUserNotificationCenter] delive

NSUserNotificationCenter configuration mysteries

2016-08-30 Thread Graham Cox
ionCenter] deliverNotification:note]; } I’m off to experiment, but if anyone knows how to tame the beast, it would save me some time. thanks, --Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin re

[SOLVED] Re: length of file from NSFileHandle?

2016-08-27 Thread Graham Cox
as about to head down that path when I noticed the above - thanks for the suggestions anyway, worth knowing for the future. —Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the lis

length of file from NSFileHandle?

2016-08-26 Thread Graham Cox
the length seems a bit wrong, is all. —Graham ___ 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

Re: Does setFormatter() retain?

2016-08-24 Thread Graham Cox
know what other objects did with every parameter passed to them programming would be impossible. Or use ARC and let the compiler figure it out. —Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or mo

Re: NSAlert::runModal doesn't work on 10.6

2016-08-23 Thread Graham Cox
ch isn’t proven one way or the other), the nib can be minimal. —Graham ___ 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.app

Re: NSAlert::runModal doesn't work on 10.6

2016-08-22 Thread Graham Cox
extEventMacthingMask: method to stand in for WaitNextEvent(). All your various problems will be solved at once. Or use Carbon, not Cocoa, but good luck with that. —Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not po

Re: GetNumEventsInQueue() for Cocoa

2016-08-21 Thread Graham Cox
t sleeping, it’s going to be a horrible citizen in terms of battery life and CPU hogging. It might even be worse than the iOS Facebook app, which is hard to believe ;-) —Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not p

Drag and Drop on iOS

2016-08-11 Thread Graham Cox
communicate between the views when the drag completes? Or is there something in UIKit that handles some of that generically? It wasn’t obvious where to look; I didn’t see anything in UIView. —Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com

Re: NSImage drawInRect deadlock

2016-08-10 Thread Graham Cox
fetching you might not even see it at all. This way your threads are naturally limited by the number of images that are shown at a time, or scrolled newly into view. —Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post ad

Re: Core Data or not

2016-08-05 Thread Graham Cox
d? While I have some sympathy for any of these “reasons”, they’re not usually a good reason for rewriting valuable code that works. For those cases, creating a new project that allows you to explore them hamlessly is likely a better idea. II

Re: NSImage from bitmap - then delete bitmap

2016-07-26 Thread Graham Cox
> On 27 Jul 2016, at 12:18 PM, Graham Cox wrote: > > The atomic setter method probably looks something like this: A further thought. If the getter method is also protected, like: - (NSImageRep*) imageRep { @synchronized( self ) { return [[_imageR

Re: NSImage from bitmap - then delete bitmap

2016-07-26 Thread Graham Cox
the main pool. Even if it’s the caller’s pool, unless you’re draining it on each loop, it may only ever get drained when the thread ends, which is safe. But it could accumulate a lot of unreleased memory which is another potential problem. Threads are tricky ;) —Graham _

Codesign assumes folder structure, fails.

2016-07-25 Thread Graham Cox
understand the long-standing versioning schema within a bundle. Bug or reasonable assumption? —Graham ___ 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

Re: NSFileHandle and thread safety

2016-07-25 Thread Graham Cox
system serialised anyway? Use multiple threads to read a single file isn’t going to gain you anything, even if there wasn’t this coherency issue. —Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or

Re: NSImage from bitmap - then delete bitmap

2016-07-23 Thread Graham Cox
all that, the copy-on-write behaviour is something I can’t find any hard documentation for. I seem to recall that this came up in a discussion about NSImage/NSBitmapImageRep a long time ago just after the internal behaviour of these classes was overhauled. That may have been in the 10.5 or

Re: NSImage from bitmap - then delete bitmap

2016-07-22 Thread Graham Cox
to terminate worker thread: workerThread.running = NO; both workerThread.running and window.imageRep are atomic properties. —Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact

Re: NSImage from bitmap - then delete bitmap

2016-07-22 Thread Graham Cox
ndow by the main > thread and can then be released. Understood, but you may as well keep it around until the next version of the image is passed across - the previous one will be released at the same time when setting the property. —Graham ___ Cocoa

Re: NSImage from bitmap - then delete bitmap

2016-07-22 Thread Graham Cox
> On 22 Jul 2016, at 5:30 PM, Quincey Morris > wrote: > > On Jul 22, 2016, at 00:08 , Graham Cox wrote: >> >> If the thread building images never goes faster than once per second, the >> time to draw the image is a fraction of that - I’m sure 60fps is achiev

Re: NSImage from bitmap - then delete bitmap

2016-07-22 Thread Graham Cox
save the 4MB per bitmap? Once upon a time the answer would definitely be yes, but 4MB isn’t much these days. —Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact th

Re: NSImage from bitmap - then delete bitmap

2016-07-21 Thread Graham Cox
Note that unless you deliberately mark the window as needing display, your window will NEVER draw from the rep, even if the user moves it revealing a covered portion - that will be filled from the backing store. —Graham ___ Cocoa-dev mailing

Re: NSImage from bitmap - then delete bitmap

2016-07-21 Thread Graham Cox
the bitmap, note that NSBitmapImageRep conforms to NSCopying. You don’t have to turn it into a TIFF and back again. Also, you don’t even need an NSImage - the NSImageRep can be drawn directly. —Graham ___ Cocoa-dev mailing list (Cocoa-dev@li

Re: NSImage from bitmap - then delete bitmap

2016-07-21 Thread Graham Cox
… done. All NSImage is is a “box” in which a bunch of NSImageReps reside. It sometimes makes those reps itself from data, etc, but you can make them yourself and add them. It’s way more efficient. —Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.a

Re: Ending NSTask doesn't release file handle opened by the task it wraps.

2016-07-21 Thread Graham Cox
> On 22 Jul 2016, at 9:22 AM, Uli Kusterer wrote: > > On 21 Jul 2016, at 17:20, Graham Cox wrote: >> One of my apps uses NSTask to wrap a command line utility that is embedded >> in the same app’s resources. This utility writes files to disk - I have no >> knowled

Ending NSTask doesn't release file handle opened by the task it wraps.

2016-07-21 Thread Graham Cox
expected behaviour? —Graham ___ 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: NSTextView pagination

2016-07-07 Thread Graham Cox
both situations. —Graham ___ 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 Subs

Re: Property synthesis trouble - 32 vs 64 bit builds

2016-07-05 Thread Graham Cox
ing in about an hour as opposed to probably several days, and most of that hour was figuring out how to correctly pass command line parameters to NSTask. It might seem sagreligious to some not to use a native API if one is available, but OTOH, sometimes the best tools are the ones to

Re: Working around radio button grouphing behaviour in 10.8 SDK?

2016-07-02 Thread Graham Cox
set which of the group is ON should not matter - the selected button might get set twice by doing that, but it’s always the same button, so it’s never seen. Burying group selection behaviour deeper than the direct receiver of the buttons' actions is a mistake, IMO. The

Tracking down this annoyance

2016-07-02 Thread Graham Cox
correctly AFAICS. I would like to get rid of the message though. Can anyone suggest a way I can debug this with a more targeted approach? —Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator

Re: Issue with read/write to NSFileHandle

2016-06-30 Thread Graham Cox
st something that allows a user to see the history of a very small set of particular events (think “activity” rather than a true log). These are not the sorts of users who are going to like being forced to use Console.app —Graham ___ Cocoa-dev mail

Re: Issue with read/write to NSFileHandle

2016-06-29 Thread Graham Cox
parate one for read and another for write? —Graham ___ 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/Unsu

Issue with read/write to NSFileHandle

2016-06-29 Thread Graham Cox
offset? If I do that, I may as well write the text directly when I update the file. This isn’t really what I want, though could probably live with it for now. —Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin

Re: Using va_list to build a formatted string

2016-06-29 Thread Graham Cox
Got it, thanks! —Graham > On 30 Jun 2016, at 12:45 PM, Wim Lewis wrote: > > You need to use -stringWithFormat:arguments: here, since you're passing in a > va_list of arguments. > > ___ Cocoa-dev mailing list (Cocoa-dev@l

Using va_list to build a formatted string

2016-06-29 Thread Graham Cox
stringWithFormat:format, argsP]; which causes an EXC_BAD_ACCESS. Obviously I’m doing it wrong, but if I use NSLogv here, it works fine. How do I turn my variadic parameters into a fully formatted string? —Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com

Re: NSTask argument list

2016-06-26 Thread Graham Cox
I was able to set a readability handler on a NSPipe, set as stdout for the NSTask. ffmpeg has a -progress option which spews a bit of easily-parsed text to the pipe, so I was able to extract the info I wanted from that. All pretty straightforward in the end. —Graham __

Re: NSTask argument list

2016-06-25 Thread Graham Cox
e file itself, not sure about the first bit. —Graham ___ 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/Unsub

Re: NSTask argument list

2016-06-25 Thread Graham Cox
Ah thanks Marco, Andy… this makes a lot more sense and works fine. —Graham > On 26 Jun 2016, at 2:30 PM, Marco S Hyman wrote: > I believe arguments is an array of arguments, not an array containing a > string that matches a command line. > > Then your arguments array shou

NSTask argument list

2016-06-25 Thread Graham Cox
s differently, but it’s not clear what I need to do. —Graham ___ 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 H

Re: Properties: A question of style

2016-06-15 Thread Graham Cox
> On 16 Jun 2016, at 3:45 AM, Jens Alfke wrote: > > >> On Jun 14, 2016, at 4:48 PM, Graham Cox wrote: >> >> @property (readonly) BOOL isFoo; >> >> or: >> >> @property (readonly, getter=isFoo) BOOL foo; > > Are you askin

Properties: A question of style

2016-06-14 Thread Graham Cox
/write properties, it’s readonly ones that I’m wondering about. —Graham ___ 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

Re: CIImage initWithCGLayer is deprecated in 10.11

2016-06-09 Thread Graham Cox
supposed advantages listed in the documentation. This was something I was told on this list by one of the Apple engineers, but that was a long time ago. It could have changed, but the deprecation of those APIs suggests that CGLayer is not the way to go. —Graham _

Re: NSFileWrapper

2016-06-05 Thread Graham Cox
dn’t have this one downside; I wonder why it doesn’t, or couldn’t simply be changed to do that. —Graham ___ 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: NSFileWrapper

2016-06-04 Thread Graham Cox
ivate knowledge about its structure. Alternatively, make up a new extension - the amount of work for your app is about the same, so the question is whether you want to disguise the change for end users. —Graham ___ Cocoa-dev mailing list (Cocoa-dev@

  1   2   3   4   5   6   7   8   9   10   >