Re: transition custom views

2017-08-11 Thread J.E. Schotsman
> On 10 Aug 2017, at 21:03, Quincey Morris > <quinceymor...@rivergatesoftware.com> wrote: > > On Aug 10, 2017, at 11:38 , J.E. Schotsman <jesc...@xs4all.nl> wrote: >> >> No, it’s a xib-based app. > > I think it’s a bit harder, because with a storybo

Re: transition custom views

2017-08-10 Thread J.E. Schotsman
> On 10 Aug 2017, at 19:38, Quincey Morris > <quinceymor...@rivergatesoftware.com> wrote: > > On Aug 10, 2017, at 08:36 , J.E. Schotsman <jesc...@xs4all.nl> wrote: >> >> I would like to use the transition(from:to:options:completionHandler:) >> m

transition custom views

2017-08-10 Thread J.E. Schotsman
Hello, In a Mac app I have a window with a tab view. One of the tabs contains custom views between which the user can switch with a popup menu. I would like to use the transition(from:to:options:completionHandler:) method of NSViewController but the tab view item's viewController property is

Re: document-scoped bookmark

2017-07-14 Thread J.E. Schotsman
> On 14 Jul 2017, at 22:20, Quincey Morris > <quinceymor...@rivergatesoftware.com> wrote: > > On Jul 14, 2017, at 11:57 , J.E. Schotsman <jesc...@xs4all.nl> wrote: >> >> I want to create document-scoped security bookmarks. >> However, there seems to be

document-scoped bookmark

2017-07-14 Thread J.E. Schotsman
Hello, I want to create document-scoped security bookmarks. However, there seems to be no API for this. On StackOverflow I’ve found two conflicting views: 1. Too bad, never implemented by Apple 2. Create the bookmark relative to the document. Can somebody please shed some light on this? TIA,

help! (book)

2017-06-26 Thread J.E. Schotsman
Hello, I still cannot get my help book anchors to work programmatically (using NSHelpManager.shared().openHelpAnchor). I checked the Help Book works when double-clicked in ~/Library/Documentation/help I’ve checked the help index file in the terminal (hiutil -A and -D). The anchors and the

Re: switching text field between editable and non-editable

2017-06-01 Thread J.E. Schotsman
Thanks to Ken & Charles for helping me solve this. My code now looks like if makeEditable { if myTextField.my_isFirstResponder { myTextField.isEditable.window?.my_commitEditing()

Re: switching text field between editable and non-editable

2017-05-31 Thread J.E. Schotsman
> On 31 May 2017, at 20:59, Charles Srstka wrote: > > Does setting its needsDisplay property to true have any effect? > > Charles No. I’ve also tried myTextField.superview!.setNeedsDisplay( myTextField.frame ) in order to get the background redrawn but again I

switching text field between editable and non-editable

2017-05-31 Thread J.E. Schotsman
Hello, 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 = false myTextField.drawsBackground =

Re: number formatter

2017-05-25 Thread J.E. Schotsman
> On 24 May 2017, at 19:53, Richard Charles wrote: > > Actually the order does not matter. You should be able to make the connection > before or after you change the formatter class to your custom class. In this case the order did matter. Maybe this is because IB

Re: number formatter

2017-05-24 Thread J.E. Schotsman
> On 24 May 2017, at 18:51, Richard Charles wrote: > > In other words the nib or xib should already contain the formatter, if not > then create one. Connect the formatter to your control as you normally would. > Then set the class of the formatter to your custom class.

number formatter

2017-05-24 Thread J.E. Schotsman
Hello I have written the simplest of formatters: class MyIntNumberFormatter:NumberFormatter { override init() { super.init() hasThousandSeparators = false } required init?( coder aDecoder:NSCoder )

Re: inactive menu item

2017-05-24 Thread J.E. Schotsman
> On 24 May 2017, at 11:11, Jonathan Mitchell wrote: > > >> On 24 May 2017, at 10:07, J.E. Schotsman <jesc...@xs4all.nl> wrote: >> >> Hello, >> >> I have a popup button with a menu item that I have set disabled in the xib. >> Every time t

inactive menu item

2017-05-24 Thread J.E. Schotsman
Hello, I have a popup button with a menu item that I have set disabled in the xib. Every time the popup is enabled the item is enabled too! Why isn’t the latent state of the item preserved? I can solve the problem by binding the enabled state of the item to a value that is always false but this

Re: scrolling woes

2017-05-20 Thread J.E. Schotsman
> On 20 May 2017, at 19:11, Saagar Jha wrote: > > Scroll views are dependent on the content size of their subviews. This can be > done > by setting unambiguous constraints to the margins of the scroll view > by manually setting the contentSize of the scroll view. > If you don’t do either of

Re: scrolling woes

2017-05-20 Thread J.E. Schotsman
> On 20 May 2017, at 20:02, Quincey Morris wrote: > >> I had a text field within a tab view item whose text was getting too large. > > Too large, as in: there are multiple lines of text whose total vertical > height exceeds the height of the text field? Yes > So I embedded it in a scroll

scrolling woes

2017-05-20 Thread J.E. Schotsman
Hello, I had a text field within a tab view item whose text was getting too large. So I embedded it in a scroll view. No matter what I tried in the xib editor, I couldn't get the scrolling to work. Does this have to be so hard? After a little googling I realised I could use a text view instead.

Re: Current, preferred way to add help to your Mac app?

2017-04-10 Thread J.E. Schotsman
> On 09 Apr 2017, at 21:00,Alastair Houghton wrote: > > You might find the following article interesting/useful: > > > Interesting! I’ll give it another try

Re: Current, preferred way to add help to your Mac app?

2017-04-09 Thread J.E. Schotsman
On 08 Apr 2017, at 21:00,Jeff Szuhay wrote: > Nevermind. I found the “Apple Help Programming Guide.” Good luck. That’s a weird mix of obsolete and newer API descriptions. The newer ones don’t work for me. openHelpAnchor:inBook: fails to open help pages for me. Or maybe the Help Indexer is

Re: disable group of controls

2017-04-05 Thread J.E. Schotsman
> On 05 Apr 2017, at 15:26, Keary Suska wrote: > > How so? You can have multiple enabled bindings on a control, and if any > return NO the control stays disabled. Aha, that solves the problem for me. I still think the Carbon user pane provided a simpler solution. >

Re: disable group of controls

2017-04-05 Thread J.E. Schotsman
> On 05 Apr 2017, at 11:48, Jack Carbaugh wrote: > > Get a list of the controls then loop through it, setting each enabled > property to false. The container holding them will hold a reference to them That way you lose the latent enabled state. When the embedder is set to

Re: disable group of controls

2017-04-05 Thread J.E. Schotsman
> On 03 Apr 2017, at 21:00, J.E. Schotsman wrote: > > What is the Cocoa way of enabling/disabling a group of controls? > In Carbon I used to use a user pane for that. > I thought I would try an NSBox but then I realized it is not a control. Nobody? I thought this would be a si

disable group of controls

2017-04-03 Thread J.E. Schotsman
Hello, What is the Cocoa way of enabling/disabling a group of controls? In Carbon I used to use a user pane for that. I thought I would try an NSBox but then I realized it is not a control. TIA, Jan E. ___ Cocoa-dev mailing list

Re: radio button contrast

2016-12-06 Thread J.E. Schotsman
> On 05 Dec 2016, at 17:23, J.E. Schotsman <jesc...@xs4all.nl> wrote: > > Hello, > > I intend to increase contrast of inactive radio buttons a little because they > are hardly legible. > The idea is to draw to a bitmap, increase contrast, draw to screen. > To my s

radio button contrast

2016-12-05 Thread J.E. Schotsman
Hello, I intend to increase contrast of inactive radio buttons a little because they are hardly legible. The idea is to draw to a bitmap, increase contrast, draw to screen. To my surprise this already increases contrast without any manipulation of the bitmap. What is going on here? class

Re: Drag and drop on table view

2016-12-02 Thread J.E. Schotsman
> On 02 Dec 2016, at 18:19, Jens Alfke wrote: > > NSTableView has a whole set of delegate calls for implementing drag & drop; > you should use those instead. For example > > - (NSDragOperation)tableView:(NSTableView*)tv > validateDrop:(id )info >

Re: Drag and drop on table view

2016-12-02 Thread J.E. Schotsman
Posted too soon. After implementing draggingUpdated it works :-) I am still not sure if I am doing this the right way (extending NSTableView) because Xcode says "Subclassing NSTableView is usually not necessary”. Jan E. ___ Cocoa-dev mailing list

Drag and drop on table view

2016-12-02 Thread J.E. Schotsman
Hello, Asking the pundits for help again... So far I am unsuccesful trying to implement drag & drop . I want to be able to drag a file or folder on a table view and process the file after that. On startup I do jobList.registerForDraggedTypes( [kUTTypeFileURL as String] ) jobList.setDropRow(

Re: return press and edit text

2016-12-01 Thread J.E. Schotsman
> On 30 Nov 2016, at 22:04, Quincey Morris wrote: > > The problem is that NSWindowController doesn’t implement the other informal > protocol (NSEditorRegistration) that is the way that editors are supposed to > be kept track of. The easiest way to get around this is for your OK button >

Re: return press and edit text

2016-11-30 Thread J.E. Schotsman
> On 30 Nov 2016, at 22:04, Quincey Morris > wrote: > > For #2, you shouldn’t need to use any delegates. Instead, you need to get the > text field to commit its edit. There is an informal protocol for this > (NSEditor), which text fields conform to. > >

return press and edit text

2016-11-30 Thread J.E. Schotsman
Hello, Today I hit an old problem again: a hit on return acts on both the default button and a text field that is being edited in the same window. The text field gets the event first, then the OK button, which is probably what the user wants. If I click on OK instead the text edits are ignored

Re: progress bar not updating

2016-10-08 Thread J.E. Schotsman
> On 08 Oct 2016, at 03:51,Quincey Morris wrote: > > Looking at the documentation a bit more carefully, though, I think it’s > implicit. Each thread, it says, can have a “current” NSProgress object, but > there can be parent-child relationships between NSProgress objects across > thread

Re: deleting connections in .xib

2016-10-07 Thread J.E. Schotsman
> On 07 Oct 2016, at 11:37, dangerwillrobinsondan...@gmail.com wrote: > > Go to the inspector palette on the right side. > With the relevant item selected you will be able to disconnect things. Oh, I see. You just need to hit the the little cross. BTW I meant editing the xib file of course.

deleting connections in .xib

2016-10-07 Thread J.E. Schotsman
Hello, I haven’t found a way yet to delete actions, outlets etc. using the xib interface. I’ve resorted to editing the project bundle with a text editor. Surely that isn’t the way this is supposed to be done? Any pointers appreciated. Jan E. ___

Re: progress bar not updating

2016-10-07 Thread J.E. Schotsman
> On 06 Oct 2016, at 22:43, Quincey Morris > wrote: > > Well, Apple has. NSProgress is a multi-purpose class, one of whose purposes > is to provide a thread-safe way of trampolining the progress completion > reports from a background worker thread to

Re: progress bar not updating

2016-10-07 Thread J.E. Schotsman
> On 06 Oct 2016, at 20:46, Ken Thomases wrote: > > When you are using bindings, you must ensure that changes to the properties > to which UI is bound happen only on the main thread. Depending on your > design, you can often do something like: > >

Re: progress bar not updating

2016-10-06 Thread J.E. Schotsman
> 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 background thread”, which is illegal. It may

progress bar not updating

2016-10-06 Thread J.E. Schotsman
Hello, I have simple progress bar in a window that refuses to update normally. Its doubleValue is bound to the progress value of my ProgressController class, so is “animating" and “indeterminate". If I print the values during a job everything is correct, but the progress bar won’t update. It

NSFileHandle and thread safety

2016-07-25 Thread J.E. Schotsman
Hello list, I find Apple’s documentation on this unclear. It says: "NSFileHandle, NSData, Cocoa streams: Most of the Foundation objects you use to read and write file data can be used from any single thread but should not be used from multiple threads simultaneously." For example I would