Re: Pro-looking Mac CAPI interfaces
> On Apr 20, 2020, at 10:25 AM, Joel Reymont <joel@stegos.com> wrote:
>
> Does anyone have examples of CAPI UIs the look professional on the Mac? I’m talking Aperture, Sketch, etc. kind of professional.
>
> All the Mac CAPI UIs I have seen (pgEditor, LW itself) look fairly toy-like compared to native Mac apps, despite using the same Mac widgets.
>
> Good UIs must boil down to styling (fonts, borders?) and I’m wondering how people do this. My ideal would be a CAPI app that’s indistinguishable from a recent native Mac app.
The short answer is you get hold of the native Objective-C objects and call native framework methods to make them behave the way you want.
I'd like to avoid doing that as much as possible, but sometimes there just doesn't seem to be a way to do what I need to do using the documented CAPI API. When that happens, I basically build the "toylike" interface, then use Lispworks inspection tools to find the native representations of the objects I need to modify, and then write code that fishes the Objective-C representations out and uses the Objective-C interface to call native framework methods on them.
In the extreme, CAPI provides a sort of kitchen-sink wrapper, COCOA-VIEW-PANE, which you can use to wrap an arbitrary NSView. Obviously, the more work you do in that context, the less portable that work is, but when you can't get the appearance and behavior you want through documented APIs, or by my sort of under-the-hood hacks, you can always just write Objective-C in Lisp to get what you want.
_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html