[gambit-list] GambitREPL on iPad

Marc Feeley feeley at iro.umontreal.ca
Tue Sep 6 11:29:57 EDT 2011


On 2011-09-06, at 10:21 AM, cormullion at mac.com wrote:

> Is there any documentation about the functions in this, such as AudioServicesPlaySound or set-webview-content? 
> 
> ta

These are not documented. Apple has asked me to remove these functions because they violate the Apple PLA. In the next version of Gambit REPL (if it ever gets approved) these functions won't be available. Apple objects to these functions because they provide a bridge between Gambit and the iOS SDK native APIs.
 
- AudioServicesPlaySound is a direct interface to the function of the same name in the iOS SDK (see http://developer.apple.com/library/ios/#documentation/AudioToolbox/Reference/SystemSoundServicesReference/Reference/reference.html).It's single argument is an integer which identifies the sound to be played (for example on the iPhone, 1010 is a predefined "funny horn" sound).

- set-webView-content can be used to change the HTML of the Gambit REPL webView.  Gambit REPL has two views: a textView (for the actual REPL) and a webView for the other pages (splash page, script editor, etc).  A script can change the HTML content of the webView with (set-webView-content <string>) and then call (show-webView) to display the webView page. To switch back to the REPL page you should call (show-textView).  For example:

(set-webView-content "<h1>Hello!</h1>")
(show-webView) ;; show the HTML
(thread-sleep! 5) ;; wait 5 seconds
(show-textView) ;; back to REPL page

With this it is possible to create simple user interfaces with HTML forms.

I suggest that you read the source code of the Gambit REPL app to have more info (specifically the file examples/iOS/program.scm in the Gambit distribution, i.e. http://www.iro.umontreal.ca/~gambit/repo/.cgit.cgi/Gambit/tree/examples/iOS/program.scm). Look at the function "splash" to see how the splash page is implemented, and specifically how to respond to the events generated when pushing the buttons.

Please ask if you have other questions.

Marc

P.S. I am continuing to discuss with Apple the approval of Gambit REPL v3.0 which adds the ability to upload scripts to a public script repository. I'm hopeful my arguments will convince them that this does not violate the PLA.

P.P.S. Nothing prevents you from compiling Gambit REPL yourself (for your personal use on your iPad/iPhone) with all the features you wish. So if the above functions are important to you, just pay for an iOS developer license ($99 I think), download the Gambit distribution, adjust examples/iOS/program.scm to your liking, fire-up Xcode, compile and upload the program to your device.

P.P.P.S. Alternatively, run "Gambit for Android" on your Android device! (see http://apps.keithflower.org/?page_id=152)




More information about the Gambit-list mailing list