StepTalk tools
From GNUstepWiki
(Difference between revisions)
| Revision as of 13:02, 18 February 2005 Stefan Urbanek (Talk | contribs) ← Previous diff |
Revision as of 15:35, 18 February 2005 Stefan Urbanek (Talk | contribs) Getting Help Next diff → |
||
| Line 34: | Line 34: | ||
| === Getting Help === | === Getting Help === | ||
| - | Get a class of an object: | + | {| border=1 |
| - | + | |+ | |
| - | 'aString' class | + | | Get a class of an object |
| - | + | | 'aString' class | |
| - | List methods that an object can respond to (superclass methods are not included): | + | |+ |
| - | + | | List methods that an object can respond to <br>(superclass methods are not included) | |
| - | 'aString' methodNames | + | | 'aString' methodNames |
| - | + | |+ | |
| - | List class methods: | + | | List class methods |
| - | + | | NSString methodNames | |
| - | NSString methodNames | + | |+ |
| - | + | | List instace methods | |
| - | List instace methods: | + | | NSString instanceMethodNames |
| - | + | |+ | |
| - | NSString instanceMethodNames | + | | Find a selector |
| - | + | | Runtime selectorsContainingString: 'init' | |
| - | Find a selector: | + | |+ |
| - | + | | Find implementors | |
| - | Runtime selectorsContainingString: 'init' | + | | Runtime implementorsOfSelector: #compare: |
| - | + | |} | |
| - | Find implementors: | + | |
| - | + | ||
| - | Runtime implementorsOfSelector: #compare: | + | |
| === AppKit === | === AppKit === | ||
Revision as of 15:35, 18 February 2005
Contents |
Script executor
The StepTalk Shell
!! StepTalk Shell
StepTalk shell is a handy tool for interactive scripting with GNUstep objects. The real name of the tool is stshell.
| Important notice: The stshell tool is not built by default by StepTalk, because it requires extra library called libreadline. |
After launching the stshell it will greet you by:
Welcome to the StepTalk shell. StepTalk > _
First steps with the shell
Try following examples, line by line
1 + 1. NSDate date. (NSHost hostWithName:'www.gnustep.org') addresses
Tab Completion
StepTalk Shell can do TAB completion of variable names, class names and selectors. Press <TAB> where indicated:
NSFileMa<TAB> defa<TAB>Ma<TAB> curr<TAB>Di<TAB>P<TAB>
Getting Help
| Get a class of an object | 'aString' class | List methods that an object can respond to (superclass methods are not included) | 'aString' methodNames | List class methods | NSString methodNames | List instace methods | NSString instanceMethodNames | Find a selector | Runtime selectorsContainingString: 'init' | Find implementors | Runtime implementorsOfSelector: #compare: |
AppKit
To use AppKit clases, execute the shell by:
$ stshell -env AppKit
or load the module at the runtime:
> Environment loadModule:'AppKit'
How to get a filename using the Open panel?
NSOpenPanel openPanel runModal ; filename
Create a Workspace object for further experiments
Workspace := NSWorkspace sharedWorkspace
Launch an application:
Workspace launchApplication:'Ink'
Open a file
Workspace openFile:'file name'
or
Workspace openFile:(NSOpenPanel openPanel runModal ; filename)
Unix Shell Equivalents
For Unix commands equivalets, refer to the Unix.txt file in the Shell source directory.
See also: StepTalk
