Post

Replies

Boosts

Views

Activity

Reply to How to use NSSpellChecker and NSTextCheckingController?
It turns out if I use a NSTextView object instead of NSTextField object the spelling and grammar are built in. So, all I had do to was the following: create a scrollable text view object and then connect the TextView as follows:  @IBOutlet var itemDescription: NSTextView! Then turn on continuous spell checking with  itemDescription.isContinuousSpellCheckingEnabled = true
Topic: UI Frameworks SubTopic: AppKit Tags:
Mar ’21
Reply to How to use combo box cell in a tableView
I changed func numberOfItemsInComboBoxCell(in comboBoxCell: NSComboBoxCell) - Int { to func numberOfItems(in comboBoxCell: NSComboBoxCell) - Int { and the error went away, however it still does not work. Also, I put a breakpoint on the function " func comboBoxCell" and it does not get called. Any Ideas how to resolve?
Topic: UI Frameworks SubTopic: AppKit Tags:
Mar ’21
Reply to How to use combo box cell in a tableView
I get an error when I added the following statement NSComboBoxCell.delegate = self The error was no delegate member for NSComboBoxCell.. So, I created a new test project which had a single view and a tableView that I added a comboBox to one of the columns without trying to use a datasource, I expected to see Item 1, Item 2 .. etc. in the column, but again nothing. Also, the comboBox is editable. There must be something basic I am missing. Still looking for an example..
Topic: UI Frameworks SubTopic: AppKit Tags:
Mar ’21
Reply to NSPrintInfo design report
Claude, Makes sense what you posted, I was hoping there was a design tool to create the drawing code. So, does that mean thinks like Font, Font Size, colors, Graphics etc. are created in PrintView Class with code? And I guess the only way to see the report is to print it? Do you have any code of a PrintView class you could share? Thanks
Topic: UI Frameworks SubTopic: AppKit Tags:
May ’21
Reply to NSPrintInfo design report
The following is the correct answer. It was supplied by Claude31 as well as an offline template he sent me. The way I do it is to design the report as a view in code. Schematically, it will be: I create a PrintView and house all the drawing in the draw function class PrintView: NSView { override func draw(_ dirtyRect: NSRect) { super.draw(dirtyRect) // Drawing code here. }} Then, to print, I call (from the handler of Print menu command for instance or from a print button in a view) let aSize = NSSize(width: printInfo.paperSize.width - 20, height: totalHeight) let printView = PrintView(frame: NSRect(origin: NSPoint(x: 1, y: 10), size: aSize)) // a full page, depending on orientation and call the printPanel         let printOp = NSPrintOperation(view: printView, printInfo: printInfo)
Topic: UI Frameworks SubTopic: AppKit Tags:
May ’21
Reply to How to call function in NSViewController?
Thanks for the reply! I tried it and I get the following: let printAction CustViewController.printCustomers(self) Instance member 'printCustomers' cannot be used on type 'CustViewController': did you mean to use a value of this type instead? The window controller I am referring to is the main window where as the view controller is from a separate/different window controller/view controller. My objective is to have a main printer control action which would control which printout would be generated when a CMD-P is pressed. One thing from another post mentioned I would need an instance just with contentViewController. Not sure how to code this as well?
Topic: UI Frameworks SubTopic: AppKit Tags:
Aug ’22