Difference between revisions of "Calico: Getting Started"

From IPRE Wiki
Jump to: navigation, search
Line 3: Line 3:
 
You can download the software from the [[CalicoDownload]] page
 
You can download the software from the [[CalicoDownload]] page
  
You can start Calico up by running the ./pyjama (Linux and Mac OSX) and pyjama.bat (Windows).
+
You can start Calico up by running the ./calico (Linux and Mac OSX) and calico.bat (Windows).
  
 
You can pass a number of "flags" to Calico. Here we pass the --help flag to see what all of the options are:
 
You can pass a number of "flags" to Calico. Here we pass the --help flag to see what all of the options are:
  
 
<pre>
 
<pre>
C:\Users\dblank\Calico>pyjama.bat --help
+
C:\Users\dblank\Calico>calico.bat --help
 
Loading Calico...
 
Loading Calico...
  
 
Calico Project, Version 0.2.4, on Microsoft Windows NT 6.1.7600.0
 
Calico Project, Version 0.2.4, on Microsoft Windows NT 6.1.7600.0
 
----------------------------------------------------------------------------
 
----------------------------------------------------------------------------
Start pyjama with the following options:
+
Start calico with the following options:
   pyjama                           Defaults to shell
+
   calico                           Defaults to shell
   pyjama FILENAME:LINE ...          Edits FILENAMEs, positioned on LINEs
+
   calico FILENAME:LINE ...          Edits FILENAMEs, positioned on LINEs
   pyjama --shell                    Brings up shell window
+
   calico --shell                    Brings up shell window
   pyjama --chat                    Brings up chat window
+
   calico --chat                    Brings up chat window
   pyjama --editor                  Brings up editor window
+
   calico --editor                  Brings up editor window
   pyjama --exec FILENAMEs          Runs FILENAMEs standalone, with graphics
+
   calico --exec FILENAMEs          Runs FILENAMEs standalone, with graphics
   pyjama --exec --nogui FILENAMEs  Runs FILENAMEs standalone, no graphics
+
   calico --exec --nogui FILENAMEs  Runs FILENAMEs standalone, no graphics
   pyjama --version                  Displays the version number (0.2.4)
+
   calico --version                  Displays the version number (0.2.4)
   pyjama --help                    Displays this message
+
   calico --help                    Displays this message
 
</pre>
 
</pre>
  
Line 29: Line 29:
 
To edit a program:
 
To edit a program:
  
  pyjama myprog.rb
+
  calico myprog.rb
  
 
To edit a program, starting on line 200:
 
To edit a program, starting on line 200:
  
  pyjama myprog.rb:200
+
  calico myprog.rb:200
  
 
To edit a bunch of programs:
 
To edit a bunch of programs:
  
  pyjama *.py
+
  calico *.py
  
 
To run a program:
 
To run a program:
  
  pyjama --exec myprog.rb
+
  calico --exec myprog.rb
  
 
To run a program that takes care of its own graphics:
 
To run a program that takes care of its own graphics:
  
  pyjama --exec --nogui myprog.rb
+
  calico --exec --nogui myprog.rb
  
 
To open up the editor and shell:
 
To open up the editor and shell:
  
  pyjama --editor --shell
+
  calico --editor --shell
  
 
''This page provides some examples of using [[Calico]].''
 
''This page provides some examples of using [[Calico]].''

Revision as of 16:14, 24 May 2011

Calico: Getting Started

You can download the software from the CalicoDownload page

You can start Calico up by running the ./calico (Linux and Mac OSX) and calico.bat (Windows).

You can pass a number of "flags" to Calico. Here we pass the --help flag to see what all of the options are:

C:\Users\dblank\Calico>calico.bat --help
Loading Calico...

Calico Project, Version 0.2.4, on Microsoft Windows NT 6.1.7600.0
----------------------------------------------------------------------------
Start calico with the following options:
  calico                            Defaults to shell
  calico FILENAME:LINE ...          Edits FILENAMEs, positioned on LINEs
  calico --shell                    Brings up shell window
  calico --chat                     Brings up chat window
  calico --editor                   Brings up editor window
  calico --exec FILENAMEs           Runs FILENAMEs standalone, with graphics
  calico --exec --nogui FILENAMEs   Runs FILENAMEs standalone, no graphics
  calico --version                  Displays the version number (0.2.4)
  calico --help                     Displays this message

Examples

To edit a program:

calico myprog.rb

To edit a program, starting on line 200:

calico myprog.rb:200

To edit a bunch of programs:

calico *.py

To run a program:

calico --exec myprog.rb

To run a program that takes care of its own graphics:

calico --exec --nogui myprog.rb

To open up the editor and shell:

calico --editor --shell

This page provides some examples of using Calico.

Calico GUI

Calico is divided into two windows:

  1. Editor
  2. Shell and Output


The Editor allows you to edit files. From the editor, you can select a section of code and press F5 to run part of your script interactively. If you don't have anything high-lighted, pressing F5 will run the entire file.

In the interactive command box, you can enter as much code as you like, ENTER will evaluate the code in the box (you may have to press ENTER twice, if you have a multi-line expression).

Example Code

See http://svn.cs.brynmawr.edu/Calico/trunk/examples

Keyboard Commands

These work for Editor and Shell.

Visual shortcuts:

  • Zoom in: Control + mouse wheel forwards
  • Zoom out: Control + mouse wheel backwards

Editing shortcuts:

  • Indent block: select and press Tab
  • Unindent block: select and press Shift+Tab
  • Undo: Control + Z
  • Redo: Control + Shift + Z
  • Cut: Control + X
  • Copy: Control + C
  • Paste: Control + V
  • Move block: Control + left mouse drag
  • Auto indent: will automatically indent to the level of the previous line
  • Unindent a line: shift + Tab
  • Indent a line: go to begging of line, press Tab key

Searching Shortcuts in the Editor:

  • Control + F: bring up search bar
  • Control + G: find next
  • Control + Shift + G: find previous
  • Enter: find next
  • Shift + Enter: find previous
  • Escape: close search bar

Selection shortcuts:

  • Select: Shift + arrow keys; Shift + Control + arrow keys; left-click and mouse drag; double-, triple- left-mouse click
  • Select all: Control + A
  • Block select: Control + Alt + mouse drag

Movement shortcuts:

  • Move by word: Control + arrow keys
  • To top: control + Home
  • to bottom: control + end
  • Beginning of line: home
  • End of line: end

Running scripts shortcuts:

  • Run the script in the command area: F5
  • Run the script in the command area, if a one-liner: Return key
  • Run the script in the command area, if a multi-liner: Return key on line with only white-space
  • Enter a blank line in command area: Enter key
  • Run selected text: F5 (puts into command area; a second F5 will run it)
  • Drag text to command area, then F5
  • Stop processing: Escape key
  • Previous command: Up arrow
  • Next command: Down key

Editor

Visual cues:

  • Yellow in margin: line has been edited
  • Green in margin: line has been edited and saved
  • Current line has grey background