Re: Confusion about System Preferences

2020-07-09 Thread Ken Thomases via Cocoa-dev
On Jul 9, 2020, at 3:41 AM, Gabriel Zachmann via Cocoa-dev wrote: > > I am confused about the way system preferences are organized (or preferences > in general). > > I read the man page of defaults(1), but it is still unclear to me what happens > when I do, for instance, > > defaults -curren

Re: Points vs pixels in a bash script

2020-06-10 Thread Ken Thomases via Cocoa-dev
On Jun 9, 2020, at 8:11 AM, Gabriel Zachmann wrote: > >> In particular, you're not taking into account the current screen resolution >> (a.k.a. display mode). The user can select different scaling for a Retina >> display in System Preferences > Displays. > > Good point. > I wasn't taking that

Re: Points vs pixels in a bash script

2020-06-08 Thread Ken Thomases via Cocoa-dev
Except that Apple specifically says they're not. From High Resolution Guidelines for OS X

Re: Points vs pixels in a bash script

2020-06-08 Thread Ken Thomases via Cocoa-dev
On Jun 8, 2020, at 4:43 PM, Gabriel Zachmann via Cocoa-dev wrote: > > I have a problem converting points (I think) to pixels in a bash script. > I'd rather not write an extra C/Cocoa utility for that. > > Using > system_profiler SPDisplaysDataType > I can retrieve the size of a Mac's display

Re: NSTimer +timerWithTimeInterval:

2020-04-29 Thread Ken Thomases via Cocoa-dev
Does this happen only when launched from Xcode, or also when launched normally? Does this happen with a different user account? Does it happen when run on another Mac? -Ken > On Apr 29, 2020, at 4:35 PM, Carl Hoefs via Cocoa-dev > wrote: > > There are no extensions or categories in the pro

Re: [OT] Re: NSTimer +timerWithTimeInterval:

2020-04-29 Thread Ken Thomases via Cocoa-dev
On Apr 29, 2020, at 5:27 PM, Sandor Szatmari via Cocoa-dev wrote: > >> On Apr 29, 2020, at 17:12, Alex Zavatone via Cocoa-dev >> wrote: >> >> Not sure about this, but in Objective-C, you’re not supposed to start >> methods with new. > > I’ve always operated under the premise that using a r

Re: Confusion about screen resolution

2020-02-22 Thread Ken Thomases via Cocoa-dev
On Feb 22, 2020, at 2:48 PM, Rick Aurbach via Cocoa-dev wrote: > > I think you are confusing pixels and points. > > A pixel is an addressable light-emitting area on the screen. Your screen > contains 2880 X 1800 pixels. > > But a typographical point is a unit of distance. There are [72] poin

Re: Confusion about screen resolution

2020-02-22 Thread Ken Thomases via Cocoa-dev
On Feb 22, 2020, at 9:02 AM, Gabriel Zachmann via Cocoa-dev wrote: > >> >> No, the default on recent Macs is scaled to slightly under 2x. >> > > It is about ~ 1.7 . > > this means that every view has to be scaled by this odd factor, before > writing its contents into the frame buffer. > I a

Re: Detect when a process has stopped responding?

2019-12-30 Thread Ken Thomases via Cocoa-dev
On Dec 30, 2019, at 3:19 PM, James Walker via Cocoa-dev wrote: > > Some Apple utilities such as Activity Monitor can detect when a process has > stopped responding to events. Is there any way to do that using public APIs? You might be able to do it by sending the process in question an innocu

Re: My eyes are failing me.

2019-02-22 Thread Ken Thomases
On Feb 22, 2019, at 10:39 AM, Alex Zavatone wrote: > > I was adding some basic networking code to a simple case test and decided to > try out NSURL URLWithString: relativeToURL: > > As can be seen in the output below, it attempts to be doing the opposite of > what is expected. All I am trying

Re: Crash in terminate: on Mavericks

2019-01-18 Thread Ken Thomases
You haven't included the nature of the crash, like an access violation or uncaught exception. That would be in the lines just above the excerpt you sent. Also, if you're able to reproduce this yourself, try running your app under the Zombies instrument template. Regards, Ken > On Jan 18, 201

Re: NSString drawAtPoint in Mojave

2018-11-07 Thread Ken Thomases
On Nov 7, 2018, at 11:40 AM, Tom Doan wrote: > >> Does the "Layer-Backed Views" section of the AppKit Release Notes for >> 10.14 explain what you're seeing? >> > ojave_10_14_release_notes/appkit_release_notes_for_macos_10_14#

Re: NSString drawAtPoint in Mojave

2018-11-06 Thread Ken Thomases
On Nov 6, 2018, at 11:51 PM, Tom Doan wrote: > > I just started testing a port of my application to Mojave. I'm having a > rather odd problem with NSString drawAtPoint withAttributes. I use > that to add text to graph windows. All the lines and fills look fine, but > the text, done with drawAt

Re: keyboard focus handling in custom controls

2018-09-10 Thread Ken Thomases
>> On 10 Sep 2018, at 13:21, iain > > wrote: >>> >>> I have an application, which has 3 controls >>> >>> [button] [custom view] [button] >>> >>> I’ve set the NextKeyView of each of them to the control to the right >>> [button] -> [custom view] -> [button] >>> >>>

Re: Recommended way to save NSPredicates in Core Data store?

2018-08-15 Thread Ken Thomases
On Aug 15, 2018, at 6:15 PM, Demitri Muna wrote: > > I'm building an interface that contains an NSPredicateEditor (think iTunes > smart playlists), and I want to save the predicate in a Core Data store. What > is the recommended way to do this? Serialize the NSPredicate object and save > it as

Re: Why are the simplest things the hardest?

2018-07-04 Thread Ken Thomases
On Jul 4, 2018, at 10:45 PM, Rick Mann wrote: > > I've overridden -acceptsFirstResponder to return true on the window > controller and view controllers. That doesn't do anything. -acceptsFirstResponder is a view method and is only called on views, not controllers. > I don't have any custom v

Re: Why are the simplest things the hardest?

2018-07-04 Thread Ken Thomases
On Jul 4, 2018, at 9:08 PM, Rick Mann wrote: > > I'm writing a new macOS app. I started with the document-based app template > (no core data). I have a custom window controller, and a hierarchy of custom > NSViewControllers embedded in a split view controller (I even subclassed the > split vie

Re: Crashes inside CFStringDeallocate

2018-05-25 Thread Ken Thomases
On May 25, 2018, at 5:44 AM, Vojtěch Meluzín wrote: > > I have received a few cases like the trace below - it always happens in OSX > 10.10 and runModalForWindow and crashes in CFStringDeallocate. Any ideas > what that could be? Have you run your app with the Zombies instrument? > […] NSStrings

Re: Decompressing JPEG data into specific format, getting raw pixels

2017-08-16 Thread Ken Thomases
On Aug 16, 2017, at 6:29 PM, Sean McBride wrote: > > > Right, but then I'm back where I started. :( Because there's (apparently) no > way to ensure that the NSBitmapImageRep I get is in a particular format, and > I absolutely need 8 bit per pixel & greyscale. It's quite old now, but the 10.6

Re: Exact definition of NSView/NSEvent coordinate system origin?

2017-08-11 Thread Ken Thomases
On Aug 11, 2017, at 11:38 AM, Sean McBride wrote: > > I'm tying to understand the exact definition of the Cocoa drawing and event > coordinate system on macOS. In particular the exact location of 0,0 and > subpixel accuracy. > > I know 0,0 is the bottom-left, but is it: > - the centre of the

Re: cell-based NSTableView, NSArrayController and first responder

2017-07-12 Thread Ken Thomases
On Jul 12, 2017, at 4:52 AM, Martin Hewitson wrote: > > I have a new bug in an application which I believe has only appeared in 10.12. > > I have a cell-based NSTableView backed by an NSArrayController, and the (new) > problem I have is that the editing of a cell ends after the first keystroke.

Re: NSWindow non-integer point sizes? (on Retina dispays)

2017-07-01 Thread Ken Thomases
On Jul 1, 2017, at 11:11 PM, Sean McBride wrote: > >> If your window is borderless, you can make it transparent and have a >> fractional-size view (subview of the contentView) do the base opaque >> drawing, thereby effectively setting the size of the window. > > Thanks for the suggestion, though

Re: NSWindow non-integer point sizes? (on Retina dispays)

2017-06-30 Thread Ken Thomases
On Jun 30, 2017, at 12:26 PM, Sean McBride wrote: > > Does anyone know what NSWindow's initWithContentRect: behaviour is with > non-integer contentRect? The docs don't say. It seems that, on a retina > display, window size can only be an even number of pixels (ie an integer > number of point

Re: APFS

2017-06-17 Thread Ken Thomases
On Jun 16, 2017, at 1:57 AM, Quincey Morris wrote: > > FWIW, the WWDC session on APFS is worth watching: > > https://developer.apple.com/videos/play/wwdc2017/715/ > > > because it relates to an inconclusive discussion we had recent

Re: KVO - deallocation with observers attached

2017-05-31 Thread Ken Thomases
On May 31, 2017, at 5:02 PM, Jonathan Mitchell wrote: > > It is common for deallocating objects to abort if they have observers still > registered. > > However in some cases it seems that an object can get deallocated with > observers attached and not abort. > > I have instrumented my test ca

Re: switching text field between editable and non-editable

2017-05-31 Thread Ken Thomases
On May 31, 2017, at 1:51 PM, J.E. Schotsman wrote: > > I have a hard time achieving what the message title says. > Depending on user settings I want a text field to be either editable or > non-editable. > > I’ve tried this: > > if makeEditable > { myTextField.isEditable = f

Re: Creating NSStrings without copying memory

2017-05-02 Thread Ken Thomases
On May 2, 2017, at 3:11 PM, Jens Alfke wrote: > > I’ve got a heap block containing many UTF-8 strings, and I’m looking for the > cheapest way to create NSString objects from them, i.e. without copying all > the characters. > > -initWithBytesNoCopy:length:freeWhenDone: would be perfect, except

Re: Mysterious write-only SMB behavior (Kirk)

2017-05-02 Thread Ken Thomases
You should have the Windows network admin examine the files for their attributes, ACLs, and other metadata. Compare with files which show up properly to see if you can identify the problematic ones. Regards, Ken On May 1, 2017, at 11:11 AM, Kirk Kerekes wrote: > > More details. > > The writ

Re: Debugging strange memory ( ? ) problem

2017-04-30 Thread Ken Thomases
On Apr 30, 2017, at 4:02 PM, Peter Hudson wrote: > > Thanks Ken. > > I'll give zombies a go. > What's baffling is that the pointer has remained the same - in terms of > address - but the type of underlying object appears to be different. > Not sure how that could happen. There's a memory m

Re: Debugging strange memory ( ? ) problem

2017-04-30 Thread Ken Thomases
On Apr 30, 2017, at 2:50 PM, Peter Hudson wrote: > > Rather too much code to post it. > Was wondering about methods to watch particular addresses of memory. Run the app under the Zombies template of Instruments. The table view, rather than being deallocated and having its address reused for s

Re: trying to use cached image as background in NSView

2017-04-03 Thread Ken Thomases
On Apr 3, 2017, at 8:54 PM, Patrick J. Collins wrote: > > I have a NSView in which I am drawing a waveform from a buffer. This > NSView has a child playhead element, that I want to move across the > waveform as it plays. The problem is, drawRect: is expensive and anytime > the playhead moves, th

Re: How to debug crash in NSOperation?

2017-03-26 Thread Ken Thomases
On Mar 26, 2017, at 10:06 PM, Gerriet M. Denkmann wrote: > > macOS 12.3 > > This is a rather rare bug (never seen before): > > Thread 12 Crashed:: Dispatch queue: เสือ :: NSOperation 0x61800184fbd0 (QOS: > UTILITY) > 0 libsystem_kernel.dylib0x7fffb3d65dd6 __pthread_kill + 10

Re: Menu Item Shortcuts Without Menu Items?

2017-03-13 Thread Ken Thomases
On Mar 13, 2017, at 5:12 PM, Frank D. Engel, Jr. wrote: > > I need to create the equivalent of a menu item shortcut, but without the menu > item... or, to assign two different shortcuts to the same menu item. > > More precisely: I have a menu item with a shortcut of Command+L. > > I need Comma

Re: boundingRectForGlyphRange is very inaccurate

2017-03-08 Thread Ken Thomases
On Mar 8, 2017, at 12:42 AM, Gerriet M. Denkmann wrote: > > Both boundingRectForGlyphRange and enumerateEnclosingRectsForGlyphRange are > right in the case of lines just containing Ascii chars. > > But for more general cases (e.g. lines containing Thai chars) > boundingRectForGlyphRange is wro

Re: boundingRectForGlyphRange is very inaccurate

2017-03-07 Thread Ken Thomases
On Mar 7, 2017, at 4:17 AM, Gerriet M. Denkmann wrote: > > On 6 Mar 2017, at 23:26, Ken Thomases wrote: >> >> Try using >> -enumerateEnclosingRectsForGlyphRange:withinSelectedGlyphRange:inTextContainer:usingBlock:. >> In particular, if you want rectangles w

Re: boundingRectForGlyphRange is very inaccurate

2017-03-06 Thread Ken Thomases
On Mar 6, 2017, at 3:41 AM, Gerriet M. Denkmann wrote: > > I am trying to get bounding rects in a TextView: > > NSRange glyphRange = [ layoutManager glyphRangeForCharacterRange: > someCharRange > > actua

Re: -forceCancel an NSOperation

2017-03-01 Thread Ken Thomases
On Mar 1, 2017, at 4:23 PM, Carl Hoefs wrote: > > The NSOperation -cancel and NSOperationQueue -cancelAllOperations methods > merely set a property that needs to be periodically and cooperatively checked > and acted upon by the receiving NSOperation. > > Normally, that is sufficient. But unde

Re: makeKeyAndOrderFront not working

2017-02-14 Thread Ken Thomases
On Feb 14, 2017, at 3:44 PM, James Walker wrote: > > I have a situation where makeKeyAndOrderFront is making a window visible but > not key. Just before this call, [theWindow canBecomeKeyWindow] returns YES, > and just after, [NSApp keyWindow] returns nil. Clicking on the window title > bar

Re: Sometimes all my menus are disabled

2017-02-12 Thread Ken Thomases
On Feb 12, 2017, at 11:01 AM, Andreas Falkenhahn wrote: > > I'm experiencing a strange issue with my app. Sometimes, maybe in 1 out of 10 > programs starts, all menus of my app are grayed out, including standard menus > like "Services", "Hide XXX", "Hide Others", "Show All", "Minimize", "Zoom", >

Re: Argh never-ending troubles with bindings

2017-02-08 Thread Ken Thomases
On Feb 8, 2017, at 5:44 PM, Rick Mann wrote: > > 2017-02-08 15:39:41.178728 PromotionalChargeManager[51621:17330300] [General] > Cannot perform operation without a managed object context > 2017-02-08 15:39:41.181165 PromotionalChargeManager[51621:17330300] [General] > ( > 0 CoreFoundati

Re: View based NSTableView bounds to NSArrayController bounds to NSUserDefaultsController

2017-02-06 Thread Ken Thomases
On Feb 6, 2017, at 8:43 AM, Steve Mills wrote: > > The problem is that when I edit values in the table, they only seem to get > written to the defaults if I add a new item after editing an existing item. > > 1. Run app. > 2. Edit existing row value. > 3. Add new row and edit it. > Result: Edite

Re: Window With Transparent Background

2017-01-24 Thread Ken Thomases
On Jan 24, 2017, at 11:17 AM, Richard Charles wrote: > > Consider a window presented as a sheet with background transparency. > > - (void)windowDidLoad > { >// Produces gray background with transparency. >NSColor *color = [NSColor colorWithRed:0.5 green:0.5 blue:0.5 alpha:0.9]; >self

Re: nswindow orderOut

2017-01-22 Thread Ken Thomases
On Jan 22, 2017, at 4:35 PM, yu...@aim.com wrote: > > I was trying to hide a minimized window using OrderOut. From the discussions > i read so far from other websites, it seemed like OrderOut would not work on > minimized window. > > What i did was to restore the minimized window first by

Re: Clarification on MMM rules for init?

2017-01-21 Thread Ken Thomases
On Jan 21, 2017, at 10:43 AM, Dave wrote: > > I’m looking at some old code and have found what I think is a long standing > bug. This is a class that has an initWithXXX method which may fail, in this > case it calls [self autorelease] and returns nil. However, I have found a > case whereby doe

Re: Refreshing Cocoa Bindings

2017-01-11 Thread Ken Thomases
On Jan 11, 2017, at 3:16 PM, Daryle Walker wrote: > > I'm going to store a reference to a model in a NSViewController's > representedObject field. The various contained views will reference that > field through KVO (Is that possible?) for their bound values. Yes, that's possible. The issue is

Re: Manually building GUI and Retina Macs

2017-01-09 Thread Ken Thomases
On Jan 9, 2017, at 10:13 AM, Andreas Falkenhahn wrote: > > I'm building some windows and controls in my app by manually > creating NSWindow objects and the respective controls and then > adding them to the NSWindow by using > > [[win contentView] addSubview:control]; > > The control and windo

Re: NSWindow not redrawing subviews

2017-01-06 Thread Ken Thomases
On Jan 7, 2017, at 12:59 AM, Tamas Nagy wrote: > > This is a video mixer app. There are multiple windows for controlling layers, > effects, etc. Rendering is done on a CVDisplayLink thread by OpenGL. Whenever > I need to update something on the UI from that CVDisplayLink thread I call > dispat

Re: NSWindow not redrawing subviews

2017-01-06 Thread Ken Thomases
On Jan 6, 2017, at 10:14 AM, Tamas Nagy wrote: > > I ran into an issues with a multi-thread, multi-window app, where one or more > windows stop displaying after a while. […] > And by saying a window stop displaying I mean there are subviews that has > been marked to be fully redrawn by setNeed

Re: Animating autolayout constraint changes for subviews

2016-12-28 Thread Ken Thomases
On Dec 28, 2016, at 1:55 PM, Doug Hill wrote: > > I can now animate my constraint changes but I notice that subviews aren't > animated. For example, I have a single view with a width constraint, and this > view has a label as a subview that expands to the size of it's parent view > via edge co

Re: device-pixel-exact bitmap rendering

2016-12-18 Thread Ken Thomases
On Dec 18, 2016, at 2:15 AM, Kurt Bigler wrote: > > But if in Displays I set the resolution to 1920x1200 "More Space", then I > can't get the backing store to match the 2880x1800 physical display > resolution. I need my NSView's backing store scale factor to be 1.5, but the > doc says this is

Re: Autolayout warnings

2016-12-14 Thread Ken Thomases
On Dec 14, 2016, at 5:15 PM, Doug Hill wrote: > > Ok, this is more good information to keep in mind when designing autolayout > constraints. Given that my design isn't animatable, it's back to the > autolayout drawing board. Again. I think it works to animate a change of constraints if you do

Re: Autolayout warnings

2016-12-14 Thread Ken Thomases
On Dec 14, 2016, at 4:19 PM, Doug Hill wrote: > > I'm seeing warnings in the console when I dynamically make autolayout > constraints active/inactive at runtime. > > I have two constraints that align a container view leading or trailing edge > with another view's edge. This is to move the cont

Re: How to know if an NSFont can draw an NSString?

2016-12-09 Thread Ken Thomases
On Dec 9, 2016, at 5:15 PM, Sean McBride wrote: > > I use an open source OpenGL-based library to do some drawing, and sometimes I > need to draw some text. This library takes UTF-8 as input and a path to a > font file to use. I use [NSFont systemFontOfSize:0.0] and get its path using > kCTFo

Re: Elementary NSUserDefaults Question

2016-12-07 Thread Ken Thomases
On Dec 7, 2016, at 9:25 AM, Charles Jenkins wrote: > > I may be misusing NSUserDefaults. I want to store the name of a background > music file, which may be nil if the user doesn’t want to hear anything. For > the time being, I have only two settings for my variable > “currentBackgroundMusicFileN

Re: How to ResolvingSymlinksInPath ?

2016-11-03 Thread Ken Thomases
On Nov 3, 2016, at 10:08 PM, Gerriet M. Denkmann wrote: > > URLByResolvingAliasFileAtURL does almost the same, has no special behaviour > with “/private”, and even can resolve an alias. > But: only when this alias is the final component of a path. > I.e. /path/aliasToFoo will be resolved to /pat

Re: How to get an undeprecated FSRef

2016-11-01 Thread Ken Thomases
On Nov 1, 2016, at 3:20 AM, Gerriet M. Denkmann wrote: > > What I really want to do: Create custom icons for folders programmatically. Use -[NSWorkspace setIcon:forFile:options:]. Regards, Ken ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Re: How to get an undeprecated FSRef

2016-11-01 Thread Ken Thomases
On Nov 1, 2016, at 2:08 AM, Gerriet M. Denkmann wrote: > > I am using ReadIconFromFSRef (not deprecated), which needs an FSRef. > > How to convert a path into an FSRef without deprecation warnings in macOS 12 ? I doubt you'll find anything. You should switch to using NSImage and -initWithCont

Re: How to count Atoms

2016-10-07 Thread Ken Thomases
On Oct 7, 2016, at 2:19 AM, Gerriet M. Denkmann wrote: > > I need (just for debugging purposes) to count something in a thread safe way. > […] > So I tried OSIncrementAtomic. > Now I get: "Implicit declaration of function 'OSIncrementAtomic' is invalid > in C99" and the linker fails, because it

Re: progress bar not updating

2016-10-06 Thread Ken Thomases
On Oct 6, 2016, at 1:36 PM, J.E. Schotsman wrote: > > >> On 06 Oct 2016, at 19:43, Jens Alfke wrote: >> >> That means that KVO is going to call the view’s observeChange method on your >> background thread, not on the main thread. Which I believe qualifies as >> “updating the UI from a backgr

Re: Normalising file names on macOS

2016-09-22 Thread Ken Thomases
On Sep 22, 2016, at 6:04 AM, John Brownie wrote: > > I find that I am in need of dealing with versions of strings that may be > turned into file names, and thus I need to be comparing normalised forms. > However, according to > https://developer.apple.com/library/content/qa/qa1173/_index.html,

Re: How to set up my NSViews?

2016-09-06 Thread Ken Thomases
On Sep 6, 2016, at 1:38 PM, Andreas Falkenhahn wrote: > > On 06.09.2016 at 18:51 Ken Thomases wrote: > >> On Sep 6, 2016, at 11:41 AM, Andreas Falkenhahn >> wrote: > >>> My NSWindow contains an NSView which I use to draw custom graphics to. It >>

Re: How to set up my NSViews?

2016-09-06 Thread Ken Thomases
On Sep 6, 2016, at 11:41 AM, Andreas Falkenhahn wrote: > > My NSWindow contains an NSView which I use to draw custom graphics to. It > doesn't > contain any widgets like buttons at all, just custom graphics drawn in > drawRect(). > > Now I'd like to have an AVPlayerView NSView on top of this v

Re: How to silently use Proxy authentication credentials from Keychain, like Safari, Mail, etc.

2016-09-06 Thread Ken Thomases
On Sep 6, 2016, at 7:36 AM, Motti Shneor wrote: > > I doubt all Apple preinstalled applications have free access to any keychain > content (passwords), or else any Apple application would serve as a potential > vulnerability and the whole point of encrypted key-chains wouldn’t worth > much. I

Re: Drawing issue with translucent borderless NSWindow, initial content half stays

2016-08-30 Thread Ken Thomases
On Aug 30, 2016, at 10:10 AM, Sean McBride wrote: > > I have a drawing bug in my app, and reduced it to a toy app. Basically, I > create an NSBorderlessWindowMask type window who's content view draws a > translucent rounded rect. Its only subview is an NSTextField that draws a > number in a

Re: Pixel-perfect migration from ATSUI to Core Text

2016-08-30 Thread Ken Thomases
On Aug 30, 2016, at 8:47 AM, Andreas Falkenhahn wrote: > >> That said, when drawing strings, there are the functions >> CGContextSetShouldSubpixelPositionFonts() and >> CGContextSetAllowsFontSubpixelPositioning(). Those can be used to >> turn off sub-pixel positioning of glyphs. It may be that

Re: Pixel-perfect migration from ATSUI to Core Text

2016-08-29 Thread Ken Thomases
On Aug 29, 2016, at 9:55 AM, Andreas Falkenhahn wrote: > > I'm migrating some code from ATSUI to Core Text. It's pretty raw stuff, i.e. > it does > all the layouting itself and only uses ATSUI/Core Text to draw single lines > of text to > raw pixel buffers and obtain measurements. > > The raw

Re: length of file from NSFileHandle?

2016-08-26 Thread Ken Thomases
On Aug 26, 2016, at 10:19 PM, Graham Cox wrote: > > Apparently a simple task, but no obvious API for it: getting the length > (size) of a file I have a NSFileHandle for. This class has no -length > property, so how can I get it? The reason it has no length property is because not all NSFileHan

Re: runModalForWindow() doesn't re-activate former window upon return

2016-08-25 Thread Ken Thomases
On Aug 25, 2016, at 6:51 AM, Andreas Falkenhahn wrote: > > Isn't runModalForWindow() supposed to activate the window which formerly > had the focus when it returns? It doesn't do this here. When > runModalForWindow() > returns, the window that was active when I called runModalForWindow() > isn't

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

2016-08-22 Thread Ken Thomases
On Aug 22, 2016, at 10:46 AM, Andreas Falkenhahn wrote: > > On 22.08.2016 at 17:30 Ken Thomases wrote: > >> On Aug 22, 2016, at 8:26 AM, Andreas Falkenhahn >> wrote: > >>> I've created an NSAlert dialog … > >>> it shows up correctly but

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

2016-08-22 Thread Ken Thomases
On Aug 22, 2016, at 8:26 AM, Andreas Falkenhahn wrote: > > I've created an NSAlert dialog as described here: > https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Dialog/Tasks/UsingAlerts.html#//apple_ref/doc/uid/2871-129009-BCIFAAEJ > > > When I run it using > > [ale

Re: NSResizableWindowMask for borderless windows

2016-08-21 Thread Ken Thomases
On Aug 21, 2016, at 6:36 AM, Andreas Falkenhahn wrote: > > There seems to be some conflicting behaviour in OS X versions concerning what > happens when combining NSBorderlessWindowMask and NSResizableWindowMask: > > - on my 10.6 system, setting NSResizableWindowMask seems to override > NSBorder

Re: odd drawInsertionPointInRect behavior

2016-08-19 Thread Ken Thomases
On Aug 16, 2016, at 9:31 PM, David Young wrote: > > I'm trying to draw my own NSTextView cursor. I expect that for each > pulse of the cursor, drawInsertionPointInRect(_:color:turnedOn:) will be > called twice, once with turnedOn == true and, shortly afterward, again > with turnedOn == false. >

Re: Reading in one window's frame auto-save size for another?

2016-08-01 Thread Ken Thomases
On Aug 1, 2016, at 7:09 PM, Alex Kac wrote: > > I have a popover that can be detached and turned into a window. When the > window is resized, its size/position is saved. Great! However I want the > popover to be the same size as the detached window when the user reopens that > popover. > > I

Re: validateUserInterfaceItem not called

2016-07-23 Thread Ken Thomases
On Jul 23, 2016, at 10:12 PM, livinginlosange...@mac.com wrote: > > I have a simple AppDelegate that instantiates an NSWindowController and > Window. I have an NSMenuItem that invokes an IBAction on the firstResponder > in my xib. This works as expected. When I press command+1, the IBAction > f

Re: NSTableView Drag/Drop - Which Column?

2016-07-23 Thread Ken Thomases
On Jul 23, 2016, at 7:53 AM, Frank D. Engel, Jr. wrote: > > Does anyone know if there is a way to determine which column of an > NSTableView something being dragged is dropped onto? > > I have drag and drop from one table in my application onto a row of another > table working, but I would lik

Re: NSImage from bitmap - then delete bitmap

2016-07-22 Thread Ken Thomases
On Jul 22, 2016, at 9:29 PM, Graham Cox wrote: > > >> On 23 Jul 2016, at 12:45 AM, Trygve Inda wrote: >> >> Because the main thread sometimes needs to ask the worker threads to >> terminate. If it does this after performOnMainThread has been called by a >> worker thread, but before the main th

Re: NSImage from bitmap - then delete bitmap

2016-07-21 Thread Ken Thomases
On Jul 22, 2016, at 1:08 AM, Trygve Inda wrote: > >> But that’s not a great way to do this. You’ve made an image, you’ve encoded >> it >> as TIFF data, then you’ve made a new image, which has decoded the TIFF data >> to >> make a new image rep/bitmap. >> >> You could just add the representatio

Re: NSImage from bitmap - then delete bitmap

2016-07-21 Thread Ken Thomases
On Jul 22, 2016, at 12:37 AM, Trygve Inda wrote: > > I create an NSBitmapImageRep: > > [[[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL > pixelsWide:pixelSize.width > pixelsHigh:pixelSize.height > bitsPerSample:8 > samplesPerPixel:4 > hasAlpha:YES > isPlanar:NO > colorSpaceName:NSDeviceR

Re: Hello. Is there a way to stop Apple CrashReporter from collecting crashes of my process?

2016-07-11 Thread Ken Thomases
On Jul 11, 2016, at 11:44 AM, Alastair Houghton wrote: > > On 11 Jul 2016, at 15:04, Motti Shneor wrote: >> >> I develop a global daemon, maintained by launchd. Obviously It cannot be >> distributed in the Mac App Store. To collect crash-reports from customers, I >> integrated a mainstream 3

Re: Mixed-state checkboxes

2016-07-08 Thread Ken Thomases
On Jul 8, 2016, at 7:36 AM, Jonathan Taylor wrote: > > I'm trying to work out the correct way to handle a mixed-state checkbox > (NSButton checkbox with allowsMixedState=YES), bound to a property on my > controller. I am intending it to serve as an "applies to all" type control at > the head

Re: Issue with read/write to NSFileHandle

2016-06-30 Thread Ken Thomases
On Jun 30, 2016, at 8:17 PM, Graham Cox wrote: > > What still seems a bit unclear is what a file handle “for update” is meant > for, if separate read and write handles are needed. You can use a single file handle for both reading and writing. It's just that you will have to seek around to rea

Re: WWDC 2016 direct download

2016-06-27 Thread Ken Thomases
On Jun 27, 2016, at 1:54 AM, Roland King wrote: > > On 27 Jun 2016, at 14:47, tridiak wrote: >> >> Where do you download the 2016 WWDC videos directly? >> Or is that not possible (why)? >> I want to watch them on my iPod touch while on work breaks. > > If you can’t run the WWDC app then go to

Re: unnamed function586 $$ AMDRadeon X4000GLDriver

2016-06-23 Thread Ken Thomases
On Jun 23, 2016, at 2:56 PM, Jonathan Mitchell wrote: > > On a rare occasion I encounter the following abort while rendering an image > in an NSImage category. > The method (shown below) gets called frequently to render resources as > grayscale. > Looks like the driver has issues but beyond tha

Re: Selected value binding in popups

2016-06-16 Thread Ken Thomases
On Jun 15, 2016, at 11:15 PM, Rick Mann wrote: > > I have a popup menu that's bound to an NSArrayController of AVCaptureDevice > objects. These objects have a "localizedName" property that I use for the > content values, and the content and content objects point to the > NSArrayController. >

Re: When can String.enumerateSubstringsInRange ever pass in NIL?

2016-05-29 Thread Ken Thomases
On May 29, 2016, at 9:54 PM, Quincey Morris wrote: > > On May 29, 2016, at 19:16 , Daryle Walker > wrote: >> >> Since I am using the substring and not including “.SubstringNotRequired”, I >> can just remove the “guard” block, tack on a “!” to substring’s identifier, >

Re: When can String.enumerateSubstringsInRange ever pass in NIL?

2016-05-28 Thread Ken Thomases
On May 28, 2016, at 8:27 PM, Daryle Walker wrote: > > The last argument to the method is a closure with four parameters. The first > argument is an optional String. I can't think of a circumstance where it'll > be NIL. (I need to know for testing.) Especially since it can be recreated in > ter

Re: All threads in app periodically blocked

2016-05-22 Thread Ken Thomases
On May 22, 2016, at 12:48 PM, Seth Willits wrote: > > I'm thoroughly confused and increasingly desperate. *All* of the threads in > my application periodically are blocked for 30-50 ms pretty regularly, about > every 150 ms. Whenever I read about symptoms like this, I think of App Nap. Try us

Re: Application Activation Problem

2016-05-14 Thread Ken Thomases
On May 13, 2016, at 10:21 AM, Dave wrote: > > That’s actually what I am doing. I monitor > NSWorkspaceApplicationWllLaunchNotification, > NSWorkspaceApplicatioDidLaunchNotification and > NSWorkspaceDidActivateApplicationNotification (as well as others). For each > notification I get I add th

Re: Progress bar problems on server persist

2016-05-05 Thread Ken Thomases
On May 5, 2016, at 10:16 AM, Steve Mills wrote: > > On May 05, 2016, at 10:07 AM, Ken Thomases wrote: > >> Don't do that. You must always shunt such work to the main thread. > > Hmm. Has that always been the case with OS X and/or Cocoa? Yes. > I know an app s

Re: Progress bar problems on server persist

2016-05-05 Thread Ken Thomases
On May 5, 2016, at 9:55 AM, Steve Mills wrote: > > On May 05, 2016, at 09:31 AM, Ken Thomases wrote: > >> Where did the idea to use timers come from? > > From you, man! March 21. :) You also mentioned turning off the animation as > one way of working around this prob

Re: Progress bar problems on server persist

2016-05-05 Thread Ken Thomases
On May 5, 2016, at 9:15 AM, Steve Mills wrote: > > A while back I started a thread about NSProgressIndicator locking up on a Mac > with no monitor. The suggested fix was to change them to use timers instead > of threads for animation. Where did the idea to use timers come from? > We thought t

Re: Custom window disappears dragging to second display

2016-05-02 Thread Ken Thomases
On May 2, 2016, at 9:26 PM, Trygve Inda wrote: > > I have a custom window that basically eliminates the large title area. > > When you drag a normal window to a second screen, as the drag is in > progress, the window appears semi-transparent on the second screen until > enough of the window cove

Re: Split view priority

2016-04-22 Thread Ken Thomases
On Apr 22, 2016, at 7:15 PM, Quincey Morris wrote: > > I have a window that contains a split view of 2 split items. The item on the > left is a source list whose width constraint is '>= 70’ @priority 1000. The > item on the right is a view whose width constraint is '>= 700’ @priority > 1000.

Re: BOOL parameter passed as nil object

2016-04-22 Thread Ken Thomases
On Apr 22, 2016, at 6:19 PM, Quincey Morris wrote: > > On Apr 22, 2016, at 16:12 , Carl Hoefs wrote: >> >> Yes, CFRunLoopPerformBlock: works well! > > But it sounded like you *didn’t* want to prevent the block from running. In > that case, dispatch_async would be all you’d need. (AFAIK, it d

Re: BOOL parameter passed as nil object

2016-04-18 Thread Ken Thomases
On Apr 18, 2016, at 8:56 PM, Carl Hoefs wrote: > > Suppose I have an object with a declared method signature: > -(void)myMethod:(BOOL)a_bool; > > Q1: If I invoke it like this: > [self performSelector:@selector(myMethod:) withObject:nil]; // nil obj > Will argument a_bool end up with a 0 value

Re: CFBridgingRetain does not leak memory

2016-04-15 Thread Ken Thomases
On Apr 15, 2016, at 4:34 AM, Tamas Nagy wrote: > > I have an ongoing project where I’m using a CFMessagePort some sort of IPC > communication. The CFMessagePort has a callback, something like this: > > static CFDataRef Callback(CFMessagePortRef port, > SInt32 messageID,

Re: Proper target for table cell view buttons

2016-04-08 Thread Ken Thomases
On Apr 8, 2016, at 11:48 AM, Quincey Morris wrote: > > You could verify this by simply removing the target connection that’s causing > the warning, and see if the action method still ends up in the right place. This doesn't make sense, since the connection is also what specifies the action.

Re: Does NSOutlineView's highlightedTableColumn work?

2016-04-04 Thread Ken Thomases
On Apr 4, 2016, at 8:39 AM, David Catmull wrote: > > Is setting the highlightedTableColumn property on an NSOutlineView supposed > to work? I’m expecting the column background to darken, but nothing seems to > happen. > > Showing the column headers didn’t help (I normally have them hidden), an

Re: Strange Delay

2016-03-30 Thread Ken Thomases
On Mar 30, 2016, at 1:44 AM, Gerriet M. Denkmann wrote: > > This is done once (OS X 10.10.5): > commonSendQueue = dispatch_queue_create( “common socket queue", > DISPATCH_QUEUE_SERIAL); > > Several objects do this quite often: > > NSDate *dax0 = [ NSDate date ]; > dispatch_async(

Re: override NSTextField paste behavior

2016-03-24 Thread Ken Thomases
On Mar 24, 2016, at 9:29 PM, Rick C. wrote: > > I have an NSPanel with 2 NSTextFields and my controller is the delegate of > the panel. I want to override the paste behavior of the 2 text fields so > that the user doesn’t paste unnecessary spaces and other characters into > these fields. Is

  1   2   3   4   5   6   7   8   9   10   >