CCL/Cocoa Interfaces Paul Krueger, Ph.D. November, 2009 Interface - - PowerPoint PPT Presentation

ccl cocoa interfaces
SMART_READER_LITE
LIVE PREVIEW

CCL/Cocoa Interfaces Paul Krueger, Ph.D. November, 2009 Interface - - PowerPoint PPT Presentation

CCL/Cocoa Interfaces Paul Krueger, Ph.D. November, 2009 Interface Goals: Looks native to platform Development effort commensurate with interface complexity Easy blending with Lisp code Usable in either stand-alone executables or from within


slide-1
SLIDE 1

CCL/Cocoa Interfaces

Paul Krueger, Ph.D. November, 2009

slide-2
SLIDE 2

Interface Goals:

Looks native to platform Development effort commensurate with interface complexity Easy blending with Lisp code Usable in either stand-alone executables or from within standard CCL IDE Cross-platform/OS portability

slide-3
SLIDE 3

My Search:

First learn Cocoa using Objective-C, Xcode and Interface Builder (IB) .../ccl/ examples/cocoa/ easygui Using Apple’ s Xcode and IB for Lisp (like Ruby & Python do) Ease of IB combined with interactivity of CCL

slide-4
SLIDE 4

Goal 1: Native Look and Feel

Only one answer for Macintosh: Cocoa in some form Turns out Cocoa may be more portable than I initially thought ...

slide-5
SLIDE 5

Goal 2: Effort/Complexity Match

Cocoa UI objects are very capable and therefore also very complex Cocoa UI object interaction protocols are quite complex Interface Builder (IB) provides a graphical interface that reduces apparent complexity, but permits complete customization

slide-6
SLIDE 6

Goal 3: Easy Blending with Lisp

Cocoa is based on Objective-C Objective-C is a very nice language (as close as a C dialect can get to something Lisp-like) CCL has provided a complete bridge to Objective-C and to Cocoa objects/functions. Can create Lisp classes that inherit from Objective-C classes Class slots accessible to both Lisp and C

slide-7
SLIDE 7

Goal 4: Stand-alone or loadable

All my example code loads into standard CCL IDE Dynamically re-define lisp or objective-C functions (but not classes) Nothing precludes using same code with minor changes/additions in stand-alone app See Mikel Evins’ APIS work for stand-alone apps: http:/

/ explorersguild.com/mikelevins/Apis_1_0.zip

slide-8
SLIDE 8

Goal 5: Portability

OK, I’m a mac guy and don’ t really care too much about this, but ... The Cocotron: http:/ /www.cocotron.org/Info Objective-C environment for many platforms and operating systems Support for Cocotron in CCL Objective-C bridge code But... Mac needed for development today

slide-9
SLIDE 9

Lisp/Cocoa Interface Projects

NIB Loading SimpleSum Menus Speech Synthesizer Lisp Packages Loan Calculator

slide-10
SLIDE 10

Project 1: NIB Loading

Key Concepts: Interface Builder NIB and XIB files NIB loading Lisp class as NIB file owner

slide-11
SLIDE 11

Project 2: SimpleSum

Key Concepts: windows text boxes buttons Lisp action methods

slide-12
SLIDE 12

Project 3: Menus

Key Concepts: Menu creation Menu addition Object delegates “First Responder” and responder chains Menu actions

slide-13
SLIDE 13

Project 4: Speech Synthesizer

Key Concepts: Speech controller Radio buttons Runtime view definition Memory management

slide-14
SLIDE 14

Project 5: Lisp Packages

Key Concepts: TableViews Lisp data sources Lisp accessor functions accessible from Objective-C objects

slide-15
SLIDE 15

Project 6: Loan Calculator

Key Concepts: Bindings Number formatters Slider controls Control enabling/disabling Alert panels

slide-16
SLIDE 16

Future Projects

Custom graphic data documents NSDocument Cocoa drawing JPEG input/output Printing support OpenGL window of some sort