Re: Context Menu and first responder targets

2023-03-05 Thread Graham Cox via Cocoa-dev
to 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
or another. All for the sake of a bit of stack 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 po

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

2017-07-06 Thread Graham Cox
in mind it would have to dearchive an 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

Increasing stack size of NSDocument's open file thread

2017-07-05 Thread Graham Cox
, the 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

Re: Very slow NSTableView

2017-07-05 Thread Graham Cox
g a pop-up button within a cell view. —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: Very slow NSTableView

2017-07-04 Thread Graham Cox
> On 5 Jul 2017, at 11:23 am, Graham Cox <graham@bigpond.com> 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 remember

Re: Very slow NSTableView

2017-07-04 Thread Graham Cox
-[NSTableView _drawContentsAtRow: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.

Re: Very slow NSTableView

2017-07-04 Thread Graham Cox
> On 4 Jul 2017, at 6:02 pm, Graham Cox <graham@bigpond.com> 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

Re: Very slow NSTableView

2017-07-04 Thread Graham Cox
> On 4 Jul 2017, at 5:39 pm, Quincey Morris > <quinceymor...@rivergatesoftware.com> wrote: > > On Jul 4, 2017, at 00:18 , Graham Cox <graham@bigpond.com> wrote: >> >> Is there a way to opt-out of vibrancy for an entire table view? > > There’

Re: Very slow NSTableView

2017-07-04 Thread Graham Cox
> On 4 Jul 2017, at 5:00 pm, Graham Cox <graham@bigpond.com> wrote: > > >> On 4 Jul 2017, at 12:29 pm, Quincey Morris >> <quinceymor...@rivergatesoftware.com> wrote: >> >> On Jul 3, 2017, at 18:19 , Graham Cox <graham@bigpond.com> w

Re: Very slow NSTableView

2017-07-04 Thread Graham Cox
> On 4 Jul 2017, at 12:29 pm, Quincey Morris > <quinceymor...@rivergatesoftware.com> wrote: > > On Jul 3, 2017, at 18:19 , Graham Cox <graham@bigpond.com> wrote: >> >> slow. as. molasses. > > What does Instruments say it’s doing? > Heh, we

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

Re: Doubled Pixels

2017-06-24 Thread Graham Cox
> On 24 Jun 2017, at 4:46 pm, Gerriet M. Denkmann <gerri...@icloud.com> 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

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 <markjal...@gmail.com> 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

Re: Doubled Pixels

2017-06-23 Thread Graham Cox
ddenly breaking your code. 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) Ple

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 <sstan...@myriad-com.com.au> wrote: > > On 19 Jun 2017, at 1:06 pm, Graham Cox <graham@bigpond.com> wrote: >> >> resource fork, Finder information, or simi

Annual codesign pain point

2017-06-18 Thread Graham Cox
se 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-dev-admins(at)lists.apple.com Help/Unsub

Re: Getting the true rotation of a UIView layer

2017-03-14 Thread Graham Cox
and 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 <edole...@gmail.com> wrote: > > I don't follow. > > On Tue, Mar 14, 2017 at 11:29

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 <edole...@gmail.com> wrote: > > Once done (I dispatch after the randomSpeed duration), I'd like to > determine the an

Re: Sometimes all my menus are disabled

2017-02-14 Thread Graham Cox
nal, to say the least. 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 moder

Re: Sometimes all my menus are disabled

2017-02-13 Thread Graham Cox
perienced with IB a few 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 p

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 <k...@ksluder.com> wrote: > >>> >>> On Feb 12, 2017, at 12:36 PM, Andreas Falkenhahn <a

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 <dary...@mac.com> wrote: &

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 <john_brow...@sil.org> wrote: > > I have undo working correctly in my macOS app, but I have a question about > action names. > > The documentation tells

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

2016-11-03 Thread Graham Cox
pointing me to 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

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

2016-10-17 Thread Graham Cox
then that might indicate a code 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 an

Re: Xcode 8 causes scroll issue when displaying keyboard

2016-10-11 Thread Graham Cox
o hacky. What if you called 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) Ple

Re: Swift 3 macOS read keyboard

2016-10-10 Thread Graham Cox
ng off 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
- it may be a disk write 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.

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

2016-09-27 Thread Graham Cox
as part of its layout process. —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/U

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

2016-09-27 Thread Graham Cox
orks exactly the same. It would be pretty hard for 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 _

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

2016-09-27 Thread Graham Cox
endings. Are you sure about that? I’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

Re: XCode documentation browser

2016-09-26 Thread Graham Cox
> On 27 Sep 2016, at 11:01 AM, Graham Cox <graham@bigpond.com> 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@

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
a list of the class hierarchy (as strings) 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 _

Re: Stupid objective-c question

2016-09-23 Thread Graham Cox
pointers are literally identical. > > No, Graham, don't do that! > > There is no guarantee that the context is a valid object. It is just supposed > to be a unique pointer value so your class can tell a KVO notification from > notifications for other observers on the same object (e.g. if a

Re: MLMediaLibrary sometimes does not call my KVO

2016-09-22 Thread Graham Cox
O on MLMediaLibrary elements, 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

Re: Stupid objective-c question

2016-09-21 Thread Graham Cox
> On 22 Sep 2016, at 10:40 AM, Quincey Morris > <quinceymor...@rivergatesoftware.com> wrote: > > On Sep 21, 2016, at 17:01 , Graham Cox <graham@bigpond.com> wrote: >> >> This should be: if([(NSString*)context >> isEqualToString:@“mediaLibraryLo

Re: Stupid objective-c question

2016-09-21 Thread Graham Cox
the pointers are literally identical. —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: MLMediaLibrary sometimes does not call my KVO

2016-09-21 Thread Graham Cox
t case you have no photos 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 adm

Re: Package installation on MacOS Sierra

2016-09-18 Thread Graham Cox
/Applications and the user drags 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 acr

Re: Replacement for CGContextSelectFont ?

2016-09-18 Thread Graham Cox
s something to ensure that works. 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

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 <a...@houseofkac.com> wrote: > > One thing you might consider is just using an attributed string: > > NSAttributedString* attrString = [[NSA

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

2016-09-08 Thread Graham Cox
of the view itself, you haven’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 co

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

2016-09-08 Thread Graham Cox
as it goes, but it’s like performing 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

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

2016-09-08 Thread Graham Cox
ocoa naming conventions for methods. The naming of the method -getArray: is misleading to say the least. —Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moder

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

2016-09-08 Thread Graham Cox
ing in the nib), so your array 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 di

Re: C callbacks with NSNotificationCenter?

2016-09-07 Thread Graham Cox
within the block. So what you’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 ad

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

2016-09-06 Thread Graham Cox
or used whatever? Docs aren’t clear. Thanks for 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 adm

Security-scoped bookmarks, what's going on?

2016-09-06 Thread Graham Cox
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 list (Cocoa-dev@lists.apple.com) Please do not pos

Re: NSUserNotificationCenter configuration mysteries

2016-08-31 Thread Graham Cox
> On 31 Aug 2016, at 10:42 AM, Graham Cox <graham@bigpond.com> wrote: > > note.identifier = self.URL.absoluteString; > > [[NSUserNotificationCenter > defau

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

[SOLVED] Re: length of file from NSFileHandle?

2016-08-27 Thread Graham Cox
; reasonable. I was 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

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
ern. If we had to 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 ad

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

2016-08-23 Thread Graham Cox
e a nib (which 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-admi

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

2016-08-22 Thread Graham Cox
t, and simply use its -nextEventMacthingMask: 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

Re: GetNumEventsInQueue() for Cocoa

2016-08-21 Thread Graham Cox
leeping, 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 post ad

Drag and Drop on iOS

2016-08-11 Thread Graham Cox
to 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
y easily tolerated. With scroll pre-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.app

Re: Core Data or not

2016-08-05 Thread Graham Cox
hands, or some other state of mind? 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 ide

Re: NSImage from bitmap - then delete bitmap

2016-07-26 Thread Graham Cox
> On 27 Jul 2016, at 12:18 PM, Graham Cox <graham@bigpond.com> 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 ) {

Re: NSImage from bitmap - then delete bitmap

2016-07-26 Thread Graham Cox
to ensure it ends up in 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 p

Codesign assumes folder structure, fails.

2016-07-25 Thread Graham Cox
to 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

Re: NSFileHandle and thread safety

2016-07-25 Thread Graham Cox
Aren’t accesses to the file 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

Re: NSImage from bitmap - then delete bitmap

2016-07-24 Thread Graham Cox
been in the 10.5 or even earlier era. —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/Unsubscrib

Re: NSImage from bitmap - then delete bitmap

2016-07-22 Thread Graham Cox
when it needs 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 modera

Re: NSImage from bitmap - then delete bitmap

2016-07-22 Thread Graham Cox
ough to be drawn into a window 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

Re: NSImage from bitmap - then delete bitmap

2016-07-22 Thread Graham Cox
> On 22 Jul 2016, at 5:30 PM, Quincey Morris > <quinceymor...@rivergatesoftware.com> wrote: > > On Jul 22, 2016, at 00:08 , Graham Cox <graham@bigpond.com> wrote: >> >> If the thread building images never goes faster than once per second, the >

Re: NSImage from bitmap - then delete bitmap

2016-07-22 Thread Graham Cox
. But is it worth it to 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

Re: NSImage from bitmap - then delete bitmap

2016-07-22 Thread Graham Cox
so slightly slower. Classic tradeoff. 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 _

Re: NSImage from bitmap - then delete bitmap

2016-07-22 Thread Graham Cox
formance, if you *do* strictly need a copy of 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 mai

Re: NSImage from bitmap - then delete bitmap

2016-07-22 Thread Graham Cox
ecause NSImage retained it … 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 ___ C

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 <witness.of.teacht...@gmx.net> wrote: > > On 21 Jul 2016, at 17:20, Graham Cox <graham@bigpond.com> wrote: >> One of my apps uses NSTask to wrap a command line utility that is embedded >> in the same app’s res

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

2016-07-21 Thread Graham Cox
. Is this the 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
adapt itself to deal with 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/Un

Re: Property synthesis trouble - 32 vs 64 bit builds

2016-07-05 Thread Graham Cox
st tools are the ones to hand. —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/Upd

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

2016-07-03 Thread Graham Cox
erving this property in order to 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. Th

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
hnical log file - it’s just 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 _

Re: Issue with read/write to NSFileHandle

2016-06-30 Thread Graham Cox
ite, as opposed to making a separate 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)

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 <w...@omnigroup.com> wrote: > > You need to use -stringWithFormat:arguments: here, since you're passing in a > va_list of arguments. > > ___ Cocoa-dev

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
; > Sandor > Thanks! 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 str

Re: NSTask argument list

2016-06-25 Thread Graham Cox
at the 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 <m...@snafu.org> wrote: > I believe arguments is an array of arguments, not an array containing a > string that matches a command line. > > Then your a

NSTask argument list

2016-06-25 Thread Graham Cox
tly, 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 Help/Unsubs

Re: Properties: A question of style

2016-06-15 Thread Graham Cox
> On 16 Jun 2016, at 3:45 AM, Jens Alfke <j...@mooseyard.com> wrote: > > >> On Jun 14, 2016, at 4:48 PM, Graham Cox <graham@bigpond.com> wrote: >> >> @property (readonly) BOOL isFoo; >> >> or: >> >> @property (readonly, gette

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

Re: CIImage initWithCGLayer is deprecated in 10.11

2016-06-09 Thread Graham Cox
ge, despite all the 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

Re: NSFileWrapper

2016-06-05 Thread Graham Cox
content lazily it wouldn’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 th

Re: NSFileWrapper

2016-06-05 Thread Graham Cox
h it is based on some private 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-de

  1   2   3   4   5   6   7   8   9   10   >