guiserver.lsp

Module index

source download

Module: guiserver.lsp

Functions for programming GUIs and 2D graphics.

Version: 1.40 use text-field as a password field with additional parameter
Version: 1.41 bug fixes for gs:listen and gs:check-event
Version: 1.42 new table UI
Version: 1.43 bug fix in new table UI action parameters
Version: 1.44 fixes in newlisp-edit.lsp
Version: 1.50 doc fixes
Version: 1.51 return value for gs:export
Version: 1.52 fix in run-shell for Java 7 update 21
Version: 1.53 doc fixes
Version: 1.60 new table functions, new naming gs:table-show-row-number
Version: 1.61 more options for gs:scroll-pane added by FdB
Version: 1.62 doc corrections
Version: 1.63 make deprecated gs:table-set-row-number work
Version: 1.70 default comm port with Guiserver are now 64001 and 64002
Version: 1.71 references to /usr/ changed to /usr/local/
Author: LM, 2008, 2009, 2010, 2015, Unya 2012, FdB 2013, LM 2015


このモジュールは、 スタンダード SUN Java RE v.1.5(ランタイム環境)がプレ・インストールされている MacOS X 10.5 (Leopard) とWindows XP でテストされています。 Linux では、オリジナルの Sun Java ランタイム環境のインストールが要求され、 プレ・インストールされている GUN Java は、互換性がありません。 インストール後は、ソフトリンクが、 /usr/bin/java で実行可能なオリジナルの java から作られなければなりません。
This module has been tested on MacOS X 10.5 (Leopard) and Windows XP, both with the Standard SUN Java RE v.1.5 (runtime environment) which came pre-installed on those platforms. On Linux the installation of the original Sun Java Runtime Environment is required the preinstalled GNU Java is not compatible. After installation a soft-link has to be made from the original java executable to /usr/bin/java.



Windows では、MIDI サウンド機能は、soundbank ファイルがインストールされていることを要求します。 詳細は、 gs:play-note の記述を見て下さい。
On Windows the MIDI sound features require a soundbank file to be installed. See the description for gs:play-note for details.

What is newLISP-GS

guiserver.lsp は、newLISP アプリケーション用に GUI(graphical user interfaces)と 2D グラフィックスを生成する Java サーバー・アプリケーション guiserver.jar にインターフェース接続するためのモジュールです。 guiserver.lsp、モジュールは、インターフェイス接続する Java Swing ライブラリ の API群より小さくより抽象化した newLISP API を実装しています。 このため、オリジナル Java API群をうかった時よりも早く GUI アプリケーションが構築されます。
guiserver.lsp is a module for interfacing to guiserver.jar a Java server application for generating GUIs (graphical user interfaces) and 2D graphics for newLISP applications. The guiserver.lsp, module implements a newLISP API much smaller and more abstract than the APIs of the Java Swing libraries which it interfaces with. Because of this, GUI applications can be built much faster than when using the original Java APIs.

Usage

プログラム・ファイルの先頭に、 次のモジュールの load 宣言文を含めておきます:
At the beginning of the program file, include a load statement for the module:
 (load "/usr/local/share/newlisp/guiserver.lsp")
 
または、MS Windows 上で:
or on MS Windows:
 (load "c:/Program Files/newlisp/guiserver.lsp")
 
guiserver.lsp は、環境変数 NEWLISPDIR で指定されたディレクトリに サーバー guiserver.jar があることを想定しています。 newLISP が開始して、この変数がまだ設定されてない時は、 MacOS X と Unix OS では、/usr/local/share/newlisp のデフォルト値に、 MS Windows システムでは、 C:\Program Files\newlispPROGRAMFILES 環境変数でみつかるディレクトリに /newlisp をつけたものになります。 これは環境変数 NEWLISPDIR に設定するようシステムに指定することで上書きされ。通常は MS Windows の %PROGRAMFILES%/newlisp に設定されます。 MS Windows バイナリ・インストーラを使った時、 NEWLISPDIR は自動的にレジストリに書かれ、リブート後にその効果を得ます。
guiserver.lsp expects the server guiserver.jar to be in the directoey specified in the environment variable NEWLISPDIR. When newLISP starts up and this variable is not set yet, it sets it to a default value of /usr/local/share/newlisp on MacOS X and Unix OSs, and to C:\Program Files\newlisp or whatever it finds in the PROGRAMFILES environment variable on MS Windows systems and adding /newlisp to it. This can be overwritten by specifying system wide setting for the environment variable NEWLISPDIR, which normally is set to %PROGRAMFILES%/newlisp on MS Windows. When using the MS Windows binary installer NEWLISPDIR is written to the registry automatically and gets into effect after rebooting.

Architecture of a newLISP GUI application

newLISP の GUI アプリケーション は、4つの部分からなります:
A GUI application in newLISP is composed of four parts:

初期化 - これは、 newLISP-GS guiserver.jar の始まりを意味し、それとの通信を初期化します。ただ一つの関数呼び出しがこのために要求されます。
initialization - this means starting the newLISP-GS guiserver.jar and initializing communications with it. Only one function call is required to do this.

ウィジェットの構築 - このステップで、ウィンドウ、ボタン、テキスト・フィールド等の GUI の全ての外観が描写されます。newLISP の newLISP-GS は、幅広い異なるコントロール・ウィジェット群を提供します。
building widgets - in this step windows, buttons, text fields etc., and all visual aspects of the GUI are described. newLISP newLISP-GS offers a wide range of different control widgets.

イベント・アクションの定義 - このステップで、 ボタン押下、キーストローク、マウス動作等の結果として GUI から来るイベントに対応する全ての関数が定義されます。 これらのイベント・アクションは、 ポップアップ・ダイアログ等でユーザーへの情報を変更するために、 多くのコマンドを GUI に返します。
defining event actions - in this step all the functions are defined to react to events coming from the GUI as a consequence of button pushes, keystrokes, mouse-movements etc.. These event actions send many commands back to the GUI to change information for the user, popup dialogs etc..

イベントの待ち受け - newLISP プログラムは、イベントを待ち、それらを定義されたイベント・アクションに振り分けるループで止まっています。 たった一つの関数呼び出しが、このために要求されます。
listening for events - the newLISP program sits in a loop waiting for events and dispatching them to the defined event actions. Only one function call is required for this step.


Example

次の例のアプリケーションは、newLISP の GUI アプリケーション の必須要素を全て示しています:
The following example application shows all the essential elements of a newLISP GUI application:

Example:
 #!/usr/bin/newlisp
 ; button-demo.lsp - demonstrate the button control
  
 ; initialization
 (load (append (env "NEWLISPDIR") "/guiserver.lsp")) 

 (gs:init) 
  
 ; describe the GUI
 (gs:frame 'ButtonDemo 100 100 400 300 "Button demo")
 (gs:set-resizable 'ButtonDemo nil)
 (gs:panel 'ColorPanel 360 200)
 (gs:set-color 'ColorPanel (random) (random) (random))
 (gs:button 'aButton 'abutton-action "color")
 (gs:set-flow-layout 'ButtonDemo "center" 2 15)
 (gs:add-to 'ButtonDemo 'ColorPanel 'aButton)
 (gs:set-visible 'ButtonDemo true)
  
 ; define actions
 (define (abutton-action id)
     (gs:set-color 'ColorPanel (random) (random) (random)))
  
 ; listen for incoming action requests and dispatch
 (gs:listen)
  
 ; eof 

Application start

     ./button-demo       ; on MacOS X and Unix
     newlisp button-demo ; on MS Windows
 
デフォルトで、guiserver.jar は、ポート 64001 と 64002 を使いますが、 この設定は、関数 gs:init にポート番号パラメータを供給するか、 コマンドラインからポート番号を上書きするかのいずれかで、上書きされます。 newLISP-GS は、供給されるポート番号とそれに続く番号を使います:
By default guiserver.jar uses the ports 64001 and 64002, but this setting can be overwritten either by supplying a port number parameter to the gs:init function or by overwriting the port number from the command-line. newLISP-GS will then use the port number supplied and the number following it:
     ./button-demo 10001       ; on MacOS X and Unix
     newlisp button-demo 10001 ; on MS Windows
 
newLISP-GS guiserver.jar は、ポート 6400164002 を使います。 1024 より下のポートは、そのほとんどが他の OS サービスの目的で既に使用されていて、それらを使うのに管理者権限が必要になるので使うべきではありません。
newLISP-GS guiserver.jar will now use the ports 10001 and 10002. Ports under 1024 should not be used, as many of them are already in use by other OS services and need administrator privileges to use them.

newLISP-GS アプリケーションを開始する二つ目の方法は、最初に guiserver.jar を開始して、その後、newLISP アプリケーションを開始します:
A second method to start a newLISP-GS application starts the guiserver.jar first, which then starts the newLISP application:
     Java -jar /usr/local/share/newlisp/guiserver.jar 64001 /usr/home/aUser/MyApplication.lsp
 
異なるポート番号を使えます。1024 より下のポートは管理者権限が必要です。 オプションで、スプラッシュスクリーンを最後のパラメータに指定できます:
A different port number can be used. Port numbers below 1024 need administrator permissions. Optionally a splash screen can be specified as the last parameter:
     Java -jar /usr/local/share/newlisp/guiserver.jar 64001 /home/apps/myapp.lsp /local/newLISP128.png
 
例は、guiserver.jar 内の画像を指定しています。 ローカル・ファイル・システム上の如何なる画像パスも使えます。
The example specifies an image inside guiserver.jar. Any other image path on the local file system can be used.

MS Windows では同方法を適切なファイル・パスに置き換えて使用できますが、 MS Windows の Java jar ファイルは実行可能としても扱われ、明白に Java を呼び出すこと無しに直接実行できます。 デフォルトで guiserver.jarguiserver.lsp は、 c:\Program Files\newlisp\ か MS Windows プラットフォーム上で PROGRAMFILES 環境変数使って特定される他のディレクトリにインストールされています:
On MS Windows similar methods can be used replacing the appropriate file paths, but on MS Windows Java jar files can also be treated as executables and executed directly without calling Java explicitly. By default guiserver.jar and guiserver.lsp are installed in c:\Program Files\newlisp\ or any other directory configured on a MS Windows platform using the PROGRAMFILES environment variable:
    "c:\Program Files\newlisp\guiserver.jar" 64001 c:\myprogs\MyApplication.lsp
 
引数文字列にスペースがある時は、クォートが必要です。 例は、newlisp.exe のパスが通っていることと、 Windows のレジストリが、 .jar のファイル拡張子と javaw.exe の関連付けを持っていることを前提にしています。 この関連付けは、WIndows で java ランタイム環境がインストールされているなら、普通に存在します。 この関連付けが、登録されていないなら、次の方法を使うことができます:
Quotes are necessary when spaces are present in the argument string. The example assumes that newlisp.exe is in the path for executables, and it also assumes that the Windows registry has an association of the .jar file extension with the javaw.exe executable. This association is normally present when a java run-time environment (JRE) is installed in Windows. If this association is not registered, the following method can be used:
    javaw -jar "c:\Program Files\newlisp\guiserver.jar" 64001 c:\myprogs\MyApplication.lsp
 
スペースを含むパス名には、クォートが必要です。
The quotes are necessary for path-names containing spaces.

Debugging

Tracing commands to newLISP-GS

デバックするには、アプリケーションの最初かトレースを開始したい次の命令を場所に置きます。
For debugging purpose put the following directive at the beginning of your application or at the place from where to start tracing.
         (gs:set-trace true)
 
そして、端末かコマンドシェルからアプリケーションを開始します。 newLISP-GS は、スタートアップやバージョン、接続メッセージと、 newLISP-GS ディスパッチャ に受け取られる各 gs:xxs 命令のトレースを出力します:
Then start the application from a terminal or command shell window. Now newLISP-GS will output startup, version and connection messages and a trace for each gs:xxs directive as it is received by the newLISP-GS dispatcher:

 newLISP-GS v.0.94
 listening on 64001
 accepted from 0.0.0.0
 connecting to 0.0.0.0 64002
 retrying to connect
 connected
 -> frame MAIN:ButtonDemo 100 100 400 300 QnV0dG9uIGRlbW8= nil
 -> set-resizable MAIN:ButtonDemo nil
 -> panel MAIN:ColorPanel 360 200
 -> set-color MAIN:ColorPanel 0 1 0 0.2
 -> button MAIN:aButton MAIN:abutton-action Y29sb3I=
 -> set-flow-layout MAIN:ButtonDemo center 2 15
 -> add-to MAIN:ButtonDemo MAIN:ColorPanel MAIN:aButton 
 -> set-visible MAIN:ButtonDemo true
 -> set-color MAIN:ColorPanel 0.8401877172 0.3943829268 0.7830992238
 server shut down
 


MAIN:ButtonDemo の最初のトレース行が示すように、 ボタン名のテキスト文字列とアイコン・パス、その他のテキストが Base64 文字列にエンコードされています。 トレース・モードをオフするには、次の命令を使います:
Text strings for button names, icon paths and other texts are encode in Base64 strings as the first trace line for MAIN:ButtonDemo shows. To switch off tracing mode use:
        (gs:set-trace nil)
 
トレース・モードがオフでも、間違ったパラメータやパラメータ無しは、 newLISP-GS が、小さいメッセージボックスにメッセージを出します。 そのようなエラーの後、アプリケーションと guiserver は、終了します。 未知のコマンドは、無視されます。 いくつかのウィジェットの適用できない関数は、エラー・メッセージ・ボックスもポップアップします。 いくつかの状況下では、関数は、影響を及ぼしません。 例えば、gs:set-sizegs:set-color は、 ウィジェットの構成やウィジェットをホスティングするレイアウト次第で、時には、影響を及ぼしません。 時には、プライベートのルックアンドフィールが色を上書きします。
Even if trace mode is switched off, wrong or missing parameters are still messaged by newLISP-GS in a small message box. After such an error the application and guiserver will exit. Unknown commands will be ignored. Functions which are not applicable to certain widgets will also pop up an error message box. In certain situations a function will have no effect, e.g. gs:set-size or gs:set-color sometimes do not have an effect, depending on how a widget is configured or depending on the layout which hosts the widget. Sometimes the platform look-and-feel overwrites colors.

Event handlers

ほとんどのウィジェットでは、イベント・ハンドラを定義すべきです。 時には、イベント・ハンドラは必要ありません。 この場合、イベント・ハンドラ・シンボルに 'gs:no-action を指定します。 プログラムを開発する時、イベント・ハンドラをコーディングする前に、それを見ることは役に立ちます。 これは、イベント・パラメータを出力することで容易にできます:
For most widgets, event handlers must be defined. Sometimes an event handler is not required. In this case specify 'gs:no-action as the event handler symbol. When developing programs it is useful to watch the event handler first before coding for it. This can be done easily by printing out event parameters:
 (gs:button 'aButton 'abutton-handler "press")
 (define (abutton-handler id)
     (println id))
 
時には、同じイベント・ハンドラが、 いくつかのウィジェット・キーボード・イベントやマウス・イベントに結び付けられています。 これらのイベントのいくつかは、より多い数のパラメータを受け取ります。 イベントの種類を見つけるには二つの簡単な方法があります:
Sometimes the same event handler function is attached to several widgets' keyboard or mouse events. Some of these events receive a greater number of parameters. There are two easy ways to discover the nature of an event:
 (define (the-handler)
     (doargs (p)
         (println "->" p)))
 
他方は、newLISP-GSから送られたイベントのソースを見ます。 これは、イベントで使われているデータ型を認識するのに役立ちます:
The other method looks at the source of the event as it was transmitted by the newLISP-GS. This is useful to recognize the data types used in the event:
 (define (the-handler)
     (println gs:event))
 
テキスト・フィールドからの全てのテキストは、base64 エンコード文字列として受け取られます。 例えば、テキスト:"Hello World" は、"SGVsbG8gV29ybGQ=" として、受け取られます:
All text from text fields are received as base64-encoded strings. E.g. the text: "Hello World" would be received as: "SGVsbG8gV29ybGQ=":
 (gs:text-field 'TextField 'textfield-handler)


(define (textfield-handler id text) (printnl id ": " (base64-dec text)))
テキスト "Hello World" は、テキスト・フィールドで入力された時、次の出力が生成されます:
When the text "Hello World" is entered in the text field, the following output would be generated:
 TextField: "Hello World"
 
テキスト・フィールドで ESC キーが押された場合、 イベント・ハンドラは、テキスト・フィールドの(訳注:入力として)nil を報告します。 従って、ハンドラは、関数 base64-dec 適用する前に、 常に文字列の内容をチェックする必要があります。
In case the ESC key is pressed in the text field, the event handler would report nil for the text field. A handler should therefore always check text for string contents before trying to apply the base64-dec function on it.

Mapping or applying gs:xxx functions

他の newLISP 関数のように、関数 gs:xxx は、 newLISP の関数 mapapply を使って パラメータのリストに マップ または アプライ されます。 こうする時、 関数 gs:xx は、コンテキスト gs の下で実行を得るので、 パラメータ・リストの先付けシンボルを正しくそれらの元のコンテキストとして(訳注:認識されるために)、 必ず クォートされた 'gs:xxx symbol をマップまたはアプライして下さい。
Like any newLISP functions, gs:xxx functions can be mapped or applied to lists of parameters using the newLISP map and apply functions. When doing this, make sure to map or apply the quoted 'gs:xxx symbol, so the gs:xx functions get executed under the gs context, prefixing symbols in parameter lists correctly with the context prefix of their origin.
    (map 'gs:panel '(first second third fourth)) ; note quoted gs: function
 

Some shortcuts when writing gs:xxx functions

関数を書く時、 newLISP と guiserver 間でテキストを渡す種類には、次のような便利なショートカットが取れます:
Due to the nature of transfer between newLISP and the guiserver as text, the following convenient shortcuts can be taken when writing functions:
ここにいくつかの例があります:
Here are some examples:
     (gs:panel 'ColorPanel 360 200)
     ; is the same as
     (gs:panel "ColorPanel" 360 200)
     ; is the same as
     (gs:panel "ColorPanel" "360" "200")
     ; is the same as
     (gs:panel "ColorPanel" 360.0 "200.00")
 
第一形式は、明解で読み易さのために好まれますが、 いくつかの場面では、他の形式を使った方が、コーディングが用意になります。
Although the first form is preferred for clarity and readability, in some cases coding may be more efficient using the other forms.

アクション・ハンドラに使われるシンボルを除いて、 全てのシンボルは、それらの表の値(term)のみ使われます。 これは、newLISP プログラミング言語の受け取ったシンボルが、 全てのコンポーネントにとってのシンボル ID として自由に使われることを意味します、 すなわち:
Except for the symbols used for action handlers, all symbols are used only by their face (term) value. This means that reserved symbols of the newLISP programming language can be used freely in symbol ids for all components, e.g:
     (gs:label 'term "Input here") ; term is a reserved name since v10.2.0
 
予約シンボル term の使用が、問題を引き起こしません。
The usage of the reserved symbol term will not pose a problem.

Return values

newLISP-GS は、イベント・ドリブンの非同期システムです。 多くの関数は、直ちにサーバーへ送った文字数を返します。 一般に、関数 gs:xxx の戻り値は、意味を持たず、捨てられます。 関数 gs:get-boundsgs:get-fontsgs:get-font-metricsgs:get-instruments gs:get-screengs:get-textgs:get-version らのみが、意味のある値もしくは値のリストを返し、 同様に名付けられた変数 gs:boundsgs:fontsgs:font-metricsgs:instrumentsgs:screengs:textgs:version に保存されます。 これらの関数はすぐに戻らず、newLISP-GS から戻り値が返ってくるくまで待ちます。
newLISP-GS is an event driven asynchronous system. Most functions return right away the number of characters sent out to the server. In general, return values of gs:xxx functions do not have any specific meaning and can be discarded. Only the functions gs:get-bounds, gs:get-fonts, gs:get-font-metrics, gs:get-instruments gs:get-screen, gs:get-text and gs:get-version return meaningful values or lists of values, which are stored in similar named variables: gs:bounds, gs:fonts, gs:font-metrics, gs:instruments, gs:screen, gs:text and gs:version. These functions will not return right away but block until the return valuse is sent back from newLISP-GS.

関数 gs:get-text は、 使われた呼び出しパターン次第で、イベント・ドリブン、または、戻り値を返す、二つの方法で動作します。
The function gs:get-text can work both ways: event driven or with a return value depending on the call pattern used.

Function overview






§

gs:add-list-item

syntax: (gs:add-list-item sym-list-combo str-text [str-text ...])
parameter: sym-list-combo - The name of the combo box or list box to which text entries are added.
parameter: str-text - The text of the entry to be added.


項目を gs:add-list-item コマンドに表記されたのと同じ順序で 存在する(訳注:sym-list-combo の)項目リストの最後に追加します。
Items are added in the same sequence as they appear in the gs:add-list-item command and added to the end of the existing list of items.

§

gs:add-separator

syntax: (gs:add-separator sym-menu-tool-bar)
parameter: sym-menu-tool-bar - The name of the tool bar or menu bar to which a spacer entry is added.


(訳注:sym-menu-tool-bar で指定されたツール・バーもしくはメニュー・バーに 分離子(separator)を追加します。)
ツール・バーもしくはメニュー・バーに追加される次のコンポーネントの前で分離子は、 OSプラットフォームによっては、見えないかもしれませんし、スペースかもしれません。
Depending on the OS platform the separator may not be visible and only occupy space before the next component added to the tool or menu bar.

§

gs:add-track

syntax: (gs:add-track int-channel list-of-notes)
parameter: int-channel - The channel belonging to this track.
parameter: list-of-notes - A list of notes. Each note is a list of key duration velocity and bend.
(訳注:MIDI シーケンスを作成します。)

gs:add-track の場合、音の持続時間を、tick 単位で与えます。 16 tick は、四分音符または、ビート です。
(訳注:つまり、最短音は、64分音符となります。)
In case of gs:add-track the duration of a note is given in ticks. 16 ticks are in a quarter note or beat.

一つの音は、4つの要素(int-key int-duration int-velocity [int-bend])のリストになります。 key, duration, velocity, bendgs:add-track で評価される変数として与えることができます。 int-bend パラメータはオプションで、無い場合 0 となります。 ピッチ・ベンド パラメータの詳細情報は、コマンド gs:play-note を見て下さい。 次のコードは、完成例です:
A note is a list of 4 elements: (int-key int-duration int-velocity [int-bend]). key duration, velocity and bend can be given as variables, which will be evaluated by gs:add-track. The int-bend parameter is optional and assumed as 0 if not present. See the command gs:play-note for more information on the note bend parameter. The following code is a complete example:

Example:
 (load (append (env "NEWLISPDIR") "/guiserver.lsp"))
 (gs:init)
 (gs:midi-init)

 (map set '(C C# D D# E F F# G G# A A# B c c# d e f f# g g# a a# b) (sequence 60 82))
 (set 'pp 30 'p 40 'm 64 'f 127) ; set velocity/volume

 (gs:midi-patch "Piano" 0)
 (gs:midi-patch "Pizzicato Strings" 1)
 (gs:midi-patch "Woodblock" 2)

 (gs:add-track 0 '( (C 12 m) (C# 4 m) (D 16 m) (c 16 f) (D 16 m)) )
 (gs:add-track 1 (dup '(d 4 pp) 16))
 (gs:add-track 2 '( (c 4 p) (c 12 p) (c 4 p) (c 12 p) (c 4 p) (c 12 p)  (c 4 p) (c 12 p)) )

 (gs:play-sequence)

 (sleep 5000)
 (gs:midi-close)
 (exit)
次の例は、音にピッチ・ベンドを使う方法を示しています:
The second example shows the usage of pitch-bend in notes:

Example:
 (load (append (env "NEWLISPDIR") "/guiserver.lsp"))
 (gs:init)
 (gs:midi-init)
 
 (gs:midi-patch "Piano" 0)
 (gs:midi-patch "Gunshot" 1)
 (gs:midi-patch "Telephone" 2)
 
 (for (n -8192 8191 128) (push (list 64 1 95 n) track0 -1))
 (for (n 64 96 2) (push (list n 8 76) track1 -1))
 
 (gs:add-track 0 track0)
 (gs:add-track 1 track1)
 (gs:add-track 2 '((44 128 127)))
 
 (gs:play-sequence)
 ;(gs:save-sequence "extremeAlarm.mid")
 
 (sleep 8000)
 (gs:midi-close)
 (exit)


§

gs:add-to

syntax: (gs:add-to sym-container sym-component [sym-componentl ...])
parameter: sym-container - The name of the container to which components are added.
parameter: sym-component - One or more symbols of the components to add.
syntax: (gs:add-to sym-container sym-component str-orientation [sym-component str-orientation ...])
parameter: sym-container - The name of the container to which components are added.
parameter: sym-component - The name of a component to add.
parameter: str-orientation - The orientation of a component to add in border layout, "north", "west", "center", "east" or "south".


(訳注:sym-container で指定されたコンテナに sym-component 以下のコンポーネントを追加します。 コンテナがボーダー・レイアウトなら、第二構文のように方位も一緒に指定します。)

§

gs:append-text

syntax: (gs:append-text sym-id str-text)
parameter: sym-id - The name of the text field or text area to which text is appended.
parameter: str-text - The text to be appended.


(訳注:sym-id で指定されたコンポーネントに str-text のテキストを追加します。 ラベルやボタンなどの gs:set-text が使えるコンポーネントに使えます。)

§

gs:button

syntax: (gs:button sym-id sym-action [str-text [int-width int-height]])
parameter: sym-id - The name of the button.
parameter: sym-action - The name of the event handler.
parameter: str-text - An optional text for the button.
parameter: int-width - The optional width of the button.
parameter: int-height - The optional height of the button.


(訳注:sym-id で指定されたボタンを生成します。  イベント・ハンドラは、次のように記述します:
(define (button-action id)
    (println "id:" id)
)
 )

§

gs:canvas

syntax: (gs:canvas sym-id)
parameter: sym-id - The name of the canvas.


(訳注:sym-id で指定されたカンバスを生成します。 カンバスは、描画したりやマウス入力イベントを受け取ったりするパネルです。 多くのアプリケーションでは、 内部的に同じ関数が呼ばれる gs:set-backgroundgs:set-color を使って、 カンバスに背景色を指定するでしょう。 移動、回転、伸縮、消去されるコンポーネントを再描画する前にカンバスは背景でクリアされます。 これを要求しないアプリケーションでも、背景色はまだ必要とされ、カンバスを搭載しているコンテナ用に指定されます。 カンバス背景は、コンテナ色で現れるでしょう、しかし、再描画前にカンバスを消すことは、実施されません。
A canvas is a panel for drawing and receiving mouse input events. For most applications a background color should be specified for the canvas using gs:set-background or gs:set-color which call the same function internally. The background forces the canvas to be cleared before redrawing components which have been moved, rotated, scaled or deleted. In applications where this is not desired but a background color is still required, the background color can be specified for the container hosting the canvas. The canvas background will then appear in the color of the container, but erasing the canvas before repainting is not enforced.

ボタン等のウィジェットも搭載することにもカンバスを使うことができます。 この場合、カンバスは デフォルトでフロア・レイアウトの gs:panel のように処理されます。 gs:panel で生成されるパネルのように他のレイアウトを指定することができます。
A canvas can also be used to host widgets like buttons etc.. In this case the canvas is treated like a gs:panel, with a flow layout by default. Similar to a panel created with gs:panel other layouts can be set.

ウィジェットがカンバスにある時、それらは、描画から浮いているように現れます。 例として、(訳注:Demo Folder にある)textrot-demo.lsp ファイルを見て下さい。 (訳注:描画オブジェクトがウィジェットの下に来ると隠れます。 描画オブジェクト同士では、先に登録したものが下になります。)
When widgets are present on a canvas they appear to be floating over the drawing. See the file textrot-demo.lsp for an example.

§

gs:channel-bend

syntax: (gs:channel-bend int-channel bend)
parameter: int-channel - The channel where the pitch bend is set.
parameter: int-bend - The channel bend between 0 and 16383.


8192 より大き数値は音程を上げるように、8192 より小さい数値は音程を下げるようにベンドします。 ベンドしたチャンネルをオフすると数値は、中間の 8192 に設定されます。 gs:channel-bend を外部音源の音程にチャンネルを持っていくことができます。
Numbers upwards of 8192 bend the tone upwards, numbers smaller than 8192 bend the tone downwards. To switch off channel bend set the number to the middle posiotion of 8192. gs:channel-bend can be used to bring a channel in tune with an external sound source.

§

channel-reverb

syntax: (gs:channel-reverb int-channel reverb)
parameter: int-channel - The channel where the reverb is set.
parameter: int-reverb - The channel reverb between 0 and 127.


指定したチャンネルの音に残響を設定します。
Sets the reverberation of the channel for all notes.

§

gs:check-box

syntax: (gs:check-box sym-id sym-action [str-text [bool-selected]])
parameter: sym-id - The name of the check box.
parameter: sym-action - The name of the event handler.
parameter: str-text - The text of the check box.
parameter: bool-selected - An optional flag indicating the selection state true or nil (default).


(訳注:sym-id で指定されたチェック・ボックスを生成します。
 イベント・ハンドラは、次のように記述します:
(define (check-action id selected)
    (println "id:" id " checked:" selected)
)
selected は、bool 型です。
 )

§

gs:check-event

syntax: (gs:check-event int-microseconds)
parameter: int-microseconds - Wait for an event a maximum of int-microseconds and execute it.


関数 gs:check-event は、 GUI からのユーザ入力待っている間にアプリケーションがいくつかの活動を実行する時、 gs:listen の代わりに使われます。 一般に、gs:check-event はループ内で使われ、いくつかのタスクを実行し、 同時にアプリケーションの GUI 部分からのイベントをチェックします。 gs:listen のように、newLISP-GS と newLISP アプリケーション・プロセス間の通信が失敗した時、 関数はアプリケーションを強制終了します。
The function gs:check-event is used as an alternative to gs:listen when the application is performing some activity while waiting for user input from the GUI. Typically gs:check-event is used in a loop, which performs some other task and at the same time checks for events from the GUI part of the application. Like gs:listen the function will force an exit of the application when communication between the newLISP-GS and the newLISP application process fails.

Example:
 (while (gs:check-event 10000) ; check for 10 milliseconds
     (do-myprocess)
 )


§

gs:clear-list

syntax: (gs:clear-list sym-id)
parameter: sum-id - The name of the list component in which to clear all entries.
(訳注:sym-id で指定されたリスト・コンポーネントの全エントリを消去します。)

§

gs:clear-text

syntax: (gs:clear-text sym-id)
parameter: sum-id - The name of the component in which to clear the text.
(訳注:sym-id で指定されたコンポーネントのテキストを消去します。)

§

gs:copy-text

syntax: (gs:copy-text sym-id)
parameter: sum-id - The name of the text component from which to copy the selection to the clipboard.
(訳注:sym-id で指定されたテキスト・コンポーネントから、 選択されているテキストをクリップボードにコピーします。)

§

gs:cut-text

syntax: (gs:cut-text sym-id)
parameter: sym-id-text - The name of the text component from which to cut selected text and place it on the clipboard..
(訳注:sym-id で指定されたテキスト・コンポーネントから、 選択されているテキストを削除し、クリップボードに移します。)

§

gs:color-dialog

syntax: (gs:color-dialog sym-parent-frame sym-action str-title float-red float-green float-blue)
parameter: sym-parent-frame - The name symbol of the parent frame.
parameter: sym-action - The symbol of the handler to call when leaving the dialog
parameter: str-title - The title of the color dialog.
parameter: float-red - The initial red color component.
parameter: float-green - The initial green color component.
parameter: float-blue - The initial blue color component.


(訳注:カラー・ダイアログを表示します。
 float-redfloat-greenfloat-blue には、それぞれ、0 から 1までの数値が入ります。  全て 1 なら白、全て 0 なら黒です。
 イベント・ハンドラは、次のように記述します:
(define (color-action id color red green blue)
    (println "id:" id "dialog-type:" color)
    (and red (println "  red:" red) (println "green:" green) (println " blue:" blue))
)
redgreenblue は、float 型です。
 )

§

gs:color-tag

syntax: (gs:color-tag sym-tag list-color [boolean-update])
parameter: sym-tag - The name tag of the shape(s) to set a new color.
parameter: list-color - The new color as a list of 3 numbers for the rgb components.
parameter: boolean-repaint - An optional flag to indicate if repainting is required (default is true).


(訳注:sym-tag でタグ付けされている 2D グラフィックス・オブジェクトの色を設定します。)

§

gs:combo-box

syntax: (gs:combo-box sym-id sym-action [str-item-1 ...])
parameter: sym-id - The name of the combo box.
parameter: sym-action - The name of the event handler.
parameter: str-item - Zero, one or more text entries in the combo box.
syntax: (gs:combo-box sym-id sym-action [list-str-items])
parameter: sym-id - The name of the combo box.
parameter: sym-action - The name of the event handler.
parameter: list-str-items - Zero, one or more text entries in a list.
(訳注:sym-id で指定されたコンボボックスを生成します。
 イベント・ハンドラは、次のように記述します:
(define (combo-action id idx item)
    (println "id:" id " index:" idx " item:" (base64-dec item))
)
index は整数で、選択された項目の順番(0 から始まる)が入ります。
item は base64 エンコードされた文字列で、選択された項目(str-item の内容)が入ります。
 )

§

gs:confirm-dialog

syntax: (gs:confirm-dialog sym-parent-frame sym-action str-title str-message [str-type])
parameter: sym-parent-frame - The symbol name of the parent frame.
parameter: sym-action - The action to perform when the diaog is closed.
parameter: str-title - The title of the message box.
parameter: str-message - The message in the message box.
parameter: str-type - The type of the message box.


メッセージ・ボックスのタイプは、"yes-no""yes-no-cancel" のいずれかです (訳注:str-type のデフォルトは、"yes-no-cancel")。 メッセージ・ボックスから返ると、sym-action が、yes の 0 か no の 1 か cancel の 2 のいずれかを運んできます。
The type of the message box can be one of: "yes-no", "yes-no-cancel" On return of the message box sym-action carries one of the responses 0 for the yes-, 1 for the no- or 2 for the cancel-button.
(訳注:確認ダイアログを表示します。
 イベント・ハンドラは、次のように記述します:
(define (confirm-action id result)
    (println "id:" id ")
    (case result
        (0 (println "yes"))
        (1 (println "no"))
        (2 (println "cancel"))
        (true (println result))
    )
)
 )

§

gs:delete-tag

syntax: (gs:delete-tag sym-tag [boolean-repaint])
parameter: sym-tag - The tag group to be deleted.
parameter: boolean-repaint - An optional flag to indicate if repainting is required (default is true).


全ての sym-tag でタグ付けされた 2D オブジェクト (line, shapes, text, image) を消去します。
Deletes all 2D objects (lines, shapes, text, images) tagged with sym-tag.

関数 gs:draw-xxx または gs:fill-xxx が呼び出される時はいつも、 グラフィックス・オブジェクトを生成します。 生成に使われるタグは、一個以上のオブジェクトをアドレスする方法です。 例として、(訳注:Demo Folder にある)mouse-demo.lsp ファイルを見て下さい。
Each time a gs:draw-xxx or gs:fill-xxx function is called a graphical object is created. The tag used during creation is a way to address one or more of these objects. See the file mouse-demo.lsp for an example.

§

gs:destroy-shell

syntax: (gs:destroy-shell sym-text-area)
parameter: sym-text-area - The name of the text component for which the shell process is destroyed.


(訳注:sym-text-area で指定されたシェルを処理しているテキスト・コンポーネントを破棄します。)

§

gs:dialog

syntax: (gs:dialog sym-id sym-parent str-title int-width int-height [boolean-visible [boolean-modal]])
parameter: sym-id - The name of the dialog
parameter: sym-parent - The name of the parent frame.
parameter: str-title - The title string of the dialog frame.
parameter: int-width - The width of the dialog frame.
parameter: int-height - The height of the dialog frame.
parameter: boolean-visible - The optional flag with a value of true or nil for visibility of the dialog.
parameter: boolean-modal - The optional flag with a value of true or nil for modality of the dialog.


(訳注:sym-id で指定された汎用ダイアログを生成します。イベントは起動されません。  ダイアログにコンポーネント(ボタン等)を追加し、そのコンポーネントのイベントを利用して下さい。)
最初、全てのウィジェットを追加するまでダイアログは可視化されません。 boolean-visibleboolean-modal が指定されない時は、nil になります。 モーダル・ダイアログは、親ウィンドウへの入力を防止します。 ダイアログには、gs:add-to を使ってコンポーネントを追加します。 レイアウト指定のセットには、 gs:set-border-layoutga:set-flow-layoutgs:set-grid-layout を使って下さい。
Initially the dialog should not be visible until all widgets are added to it. When no flags for visibility and modality are specified, nil is assumed. A modal dialog will prevent input in the parent window. Components can be added to a dialog using gs:add-to. Use the gs:set-border-layout, ga:set-flow-layout or gs:set-grid-layout to set a specific layout.

§

gs:disable

syntax: (gs:disable sym-id-1 [sym-id-2 ...])
parameter: sym-id - The name of the component to disable.


(訳注:sym-id-1 以下で指定されたコンポーネントをディスエーブルします。)
ディスエーブルされたコンポーネントは灰色にされ、入力を受け付けません。
Disabled components are grayed and do not accept input.

§

gs:dispose

syntax: (gs:dispose sym-id)
parameter: sym-id - The name of the component to dispose of.
(訳注:sym-idで指定されたコンポーネントを破棄します。)
gs:dialoggs:framegs:windowで作成されたオブジェクトは、gs:dispose でのみ削除されます。
Only objects created with gs:dialog, gs:frame or gs:window can be deleted with gs:dispose.

§

gs:dispose-splash

syntax: (gs:dispose-splash)


newLISP 起動前の newLISP-GS プロセス開始時に、スプラッシュ画面を指定できます。 関数 gs:dispose-splash は、newLISP GUI アプリケーションが始まった後、 スプラッシュ画像を消すのに使われます。
A splash screen can be specified when starting the newLISP-GS process before newLISP. The function gs:dispose-splash is used to turn off the splash image after the newLISP GUI application has started.

Example:
 java -jar /usr/local/share/newlisp/guiserver.jar 64001 program.lsp /local/newLISP128.png
 ; or on MS Windows
 java -jar "c:\Program Files\newlisp\guiserver.jar" 64001 "newlisp program.lsp" /local/newLISPsplashWin.png
例は、 program.lsp アプリケーションと組込 newLISP ロゴを示すスプラッシュ画面とポート64001/2 を使用して、 newLISP-GS を開始します。 代わりに、違う画像のフル・パウ名を指定できます。 program.lsp 内の関数 gs:dispose-splash かイメージへのマウス・クリックが、 スプラッシュ画面を消します。 program.lsp には、フル・パス名が必要かもしれません。 MS Windows では、guiserver.jar へのスペースを含む引数を囲むのにクォートが必要です。
The example starts newLISP-GS with an application program.lsp and a splash screen showing the built-in newLISP logos and using port 64001/2. Instead, the full pathname of a different image file can be specified. Inside program.lsp the function gs:dispose-splash or a mouse click on the image will turn off the splash screen. For program.lsp the full pathname may be necessary. On MS Windows quotes are necessary to bracket arguments to guiserver.jar which contain spaces.

§

gs:draw-arc

syntax: (gs:draw-arc sym-tag int-x int-y int-width int-height int-start int-angle [list-rgb])
parameter: sym-tag - The tag group of the arc.
parameter: int-x - The X position of the arc.
parameter: int-y - The Y position of the arc.
parameter: int-width - The width of the arc.
parameter: int-height - The height of the arc.
parameter: int-start-angle - The start angle of the arc in 0 to 360 degrees.
parameter: int-arc-angle - The opening angle of the arc in 0 to 360 degrees.
parameter: list-rgb - The outline color as a list of 3 numbers for the rgb components


結果の円弧は、int-start-angle から int-arc-angle 度、現在の色を使って描かれます。 (訳注:開始)角度は、0 度が 3 時方向になっています。 正の値は、反時計回りの回転を示し、負の値は時計回りの回転を示します。
(訳注:原点 (x, y) は、左上隅で、幅 (width) は右方向、高さ (height) は下方向に伸びます。)
The resulting arc begins at int-start-angle and extends for int-arc-angle degrees, using the current color. Angles are interpreted such that 0 degrees is at the 3 o'clock position. A positive value indicates a counter-clockwise rotation while a negative value indicates a clockwise rotation.

円弧の中心は、原点 (x, y) と幅(width)と高さ(height)引数で指定される大きさの長方形の中心です。
The center of the arc is the center of the rectangle whose origin is (x, y) and whose size is specified by the width and height arguments.

(訳注:マウス・イベントが使える範囲として、)
結果の円弧は、幅 int-width ピクセル、高さ int-height ピクセルの領域をカバーします。
The resulting arc covers an area int-width pixels wide by int-height pixels tall.
(訳注:線の太さは、gs:set-stroke で指定できますが、 上記領域をはみ出した部分はカバーされません。)

§

gs:draw-circle

syntax: (gs:draw-circle sym-tag int-x int-y int-radius [list-rgb])
parameter: sym-tag - The tag group of the circle.
parameter: int-x - The X position of the circle center.
parameter: int-y - The Y position of the circle center.
parameter: int-radius - The radius of the circle.
parameter: list-rgb - The outline color as a list of 3 numbers for the rgb components


円の外形を生成します。色数値は、リスト形式で入力しなければなりません。 list-rgb 無しで使われると、gs:set-paint で指定された現在の色が使われます。
Creates the outline of a circle. The color numbers must be entered in list form. If no list-rgb is used the current paint specified with gs:set-paint is used.
(訳注:線の太さは、gs:set-stroke で指定できます。)

§

gs:draw-ellipse

syntax: (gs:draw-ellipse sym-tag int-x int-y int-radius-x int-radius-y [list-rgb])
parameter: sym-tag - The tag group of the ellipse.
parameter: int-x - The X position of the ellipse center.
parameter: int-y - The Y position of the ellipse center.
parameter: int-radius-x - The radius of the ellipse.
parameter: int-radius-y - The radius of the ellipse.
parameter: list-rgb - The outline color as a list of 3 numbers for the rgb components


楕円の外形を生成します。色数値は、リスト形式で入力しなければなりません。 list-rgb 無しで使われると、gs:set-paint で指定された現在の色が使われます。
Creates the outline of an ellipse. The color numbers must be enterd in list form. If no list-rgb is used the current paint specified with gs:set-paint is used.
(訳注:線の太さは、gs:set-stroke で指定できます。)

§

gs:draw-image

syntax: (gs:draw-image sym-tag str-path int-x int-y [int-width int-height])
parameter: sym-tag - The tag group of the image.
parameter: str-path - The file path-name of the image.
parameter: int-x - The X position of the image top left corner.
parameter: int-y - The Y position of the image top left corner.
parameter: int-width - The optional width in which to draw the image.
parameter: int-height - The optional height in which to draw the image.


(訳注:.jpg, .png, .gif フォーマットの画像を表示します。)
int-widthint-height パラメータが指定され、 画像の元のサイズと同じでない時、画像は圧縮または伸長されて表示されます。
When int-width and int-height parameters are specified and they are not equal to the original size of the image (measured in pixels) the image will be displayed in either compressed or zoomed form.

§

gs:draw-line

syntax: (gs:draw-line sym-tag int-x1 int-y1 int-x2 int-y2 [list-rgb])
parameter: sym-tag - The tage of the line.
parameter: int-x1 - The X position of the first point.
parameter: int-y1 - The Y position of the first point.
parameter: int-x2 - The X position of the second point.
parameter: int-y2 - The Y position of the second point.


ラインを描画します。色数値は、リスト形式で入力しなければなりません。 list-rgb 無しで使われると、gs:set-paint で指定された現在の色が使われます。
Draws a line. The color numbers must be entered in list form. If no list-rgb is used the current paint specified with gs:set-paint is used.
(訳注:線の太さは、gs:set-stroke で指定できます。)

§

gs:draw-path

syntax: (gs:draw-path sym-tag list-points [list-rgb])
parameter: sym-tag - The tage group of the path.
parameter: list-points - The list of x and y coordinates of the points.


list-points で見つかったポイントで経路を描画します。
Draws a path with the points found in list-points.

Example:
 (gs:draw-path 'P '(1 0 2 2 3 0))
例は、ポイント 1,0, 2,2, 3,0 で、 ベース無しの下(訳注:原文は上です)が先端の三角形を描くでしょう。
The example will draw an upwards-pointing triangle without base at the points 1,0, 2,2 and 3,0
(訳注:線の太さは、gs:set-stroke で指定できます。)

§

gs:draw-polygon

syntax: (gs:draw-polygon sym-tag list-points [list-rgb])
parameter: sym-tag - The tag group of the polygon.
parameter: list-points - The list of x and y coordinates of the points.


list-points で見つかったポイントで多角形を描画します。
Draws a polygon with the points found in list-points.

Example:
 (gs:draw-polygon 'P '(1 0 2 2 3 0))
例は、ポイント 1,0, 2,2, 3,0 で、 下(訳注:原文は上です)が先端の三角形を描くでしょう。
The example will draw an upwards-pointing triangle with the points 1,0, 2,2 and 3,0.
(訳注:線の太さは、gs:set-stroke で指定できます。)

§

gs:draw-rect

syntax: (gs:draw-rect sym-tag int-x int-y int-width int-height [list-rgb])
parameter: sym-tag - The tag group of the rectangle.
parameter: int-x - The X position of the top left corner.
parameter: int-y - The Y position of the top left corner.
parameter: int-width - The width of the rectangle.
parameter: int-height - The height of the rectangle..
parameter: list-rgb - The outline color as a list of 3 numbers for the rgb components


長方形の外形を描画します。色数値は、リスト形式で入力しなければなりません。 list-rgb 無しで使われると、gs:set-paint で指定された現在の色が使われます。
Creates the outline of a rectangle. The color numbers must be entered in list form. If no list-rgb is used the current paint specified with gs:set-paint is used.
(訳注:線の太さは、gs:set-stroke で指定できます。)

§

gs:draw-round-rect

syntax: (gs:draw-round-rect sym-tag int-x int-y int-width int-height int-arc-width int-arc-height [list-rgb])
parameter: sym-tag - The tag group of the round rectangle.
parameter: int-x - The X position of the top left corner.
parameter: int-y - The Y position of the top left corner.
parameter: int-width - The width of the rectangle.
parameter: int-height - The height of the rectangle..
parameter: int-arc-width - The width of the corner rectangle.
parameter: int-arc-height - The height of the corner rectangle..
parameter: list-rgb - The outline color as a list of 3 numbers for the rgb components


角を丸めた長方形を描画します。丸めは、丸める円弧を内包する長方形で指定されます。
Draws a rectangle shape with round corners. The rounding is defined by the rectangle enclosing the rounding arc.
(訳注:線の太さは、gs:set-stroke で指定できます。)

§

gs:draw-text

syntax: (gs:draw-text sym-tag str-text int-x int-y [list-rgb [float-angle])
parameter: sym-tag - The tag group of the text.
parameter: str-text - The text to be drawn.
parameter: int-x - The X position of the text.
parameter: int-y - The Y position of the text.
parameter: list-rgb - The optonal color for the text.
parameter: float-angle - The optional angle for text in degrees


(訳注:テキストを描画します。)
list-rgb 無しで使われると、gs:set-paint で指定された現在の色が使われます。 オプションの角度は、デフォルトは水平の 0 です。 90 の値は、テキストをx, y 位置を中心に時計回りに下向きにします。
If no list-rgb is used, the current paint specified with gs:set-paint is used. The optional angle is 0 by default for horizontal text. A value of 90 will rotate the text around the x, y position downwards clockwise.
(訳注:フォントの種類や大きさは、gs:set-font で指定できます。)

§

gs:enable

syntax: (gs:enable sym-id-1 [sym-id-2 ...])
parameter: sym-id - The name of a component to enable.


(訳注:sym-id-1 以下ののコンポーネントをイネーブルにします。)
コンポーネントは、デフォルトでイネーブルです。
Components are enabled by default.

§

gs:eval-shell

syntax: (gs:eval-shell sym-id-text-area str-command)
parameter: sym-id-text-area - The name of the text area in which to evaluate text.
parameter: str-command - The text to evaluate in the shell.
(訳注:str-commandsym-id-text-area で指定されたテキスト・エリアで評価します。
 指定されたテキスト・エリアでは、gs:run-shell が走っている必要があります。)

§

gs:export

syntax: (gs:export str-path-file [int-width int-height])
parameter: str-path-file - The path and file name of the image file to write to.
parameter: int-width - The optional width of the image in pixels.
parameter: int-height - The optional height of the image in pixels.


幅と高さが指定されないなら、カンバスの現在のサイズになります。
If no width and height are specified, the current size of the canvas is assumed.

Example:
 (gs:export "/usr/home/pictures/mypic.png")
これは、画面に見えるイメージそのままの .png ファイルを生成します。 カラー・フォーマットは、8ビットRGB と アルファ・チャンネル(訳注:透過度情報)です。 カンバスに背景色が指定されていない時、背景は透明色になります。
This will generate a .png file exactly as the image seen on the screen. The color format is RGBA with 8 bit per color and an alpha channel. When no background color is defined for the canvas, the background will be transparent.

幅と高さが指定された時は、 画面に見えているカンバスの一部もしくは、それ以上の部分をイメージとして出力します。
When specifying width and height, a smaller or bigger portion of the canvas than seen on the screen is printed to the image.
(訳注:左上隅を原点にして指定した幅と高さが切り取られます。 幅と高さがカンバスより大きい場合は、何も描かれていなところは透明色で埋められます。)

§

gs:fill-arc

syntax: (gs:fill-arc sym-tag int-x int-y int-width int-height int-start int-angle [list-rgb])
parameter: sym-tag - The tag group of the arc.
parameter: int-x - The X position of the arc.
parameter: int-y - The Y position of the arc.
parameter: int-width - The width of the arc.
parameter: int-height - The height of the arc.
parameter: int-start-angle - The start angle of the arc in 0 to 360 degrees.
parameter: int-arc-angle - The opening angle of the arc in 0 to 360 degrees.
parameter: list-rgb - The outline color as a list of 3 numbers for the rgb components.


結果の円弧(訳注:扇型)は、int-start-angle から int-arc-angle 度、現在の色を使って描画します(訳注:そして、塗りつぶします)。 (訳注:開始)角度は、0 度が 3 時方向になっています。 正の値は、反時計回りの回転を示し、負の値は時計回りの回転を示します。 (訳注:原点 (x, y) は、左上隅で、幅 (width) は右方向、高さ (height) は下方向に伸びます。)
The resulting arc begins at int-start-angle and extends for int-arc-angle degrees, using the current color. Angles are interpreted such that 0 degrees is at the 3 o'clock position. A positive value indicates a counter-clockwise rotation while a negative value indicates a clockwise rotation.

円弧の中心は、原点 (x, y) と幅(width)と高さ(height)引数で指定される大きさの長方形の中心です。
The center of the arc is the center of the rectangle whose origin is (x, y) and whose size is specified by the width and height arguments.

(訳注:マウス・イベントが使える範囲として、) 結果の円弧は、幅 int-width ピクセル、高さ int-height ピクセルの領域をカバーします。
The resulting arc covers an area int-width pixels wide by int-height pixels tall.


§

gs:fill-circle

syntax: (gs:fill-circle sym-tag int-x int-y int-radius [list-rgb])
parameter: sym-tag - The tag group of the circle.
parameter: int-x - The X position of the circle center.
parameter: int-y - The Y position of the circle center.
parameter: int-radius - The radius of the circle.
parameter: list-rgb - The outline color as a list of 3 numbers for the rgb components.


塗りつぶした円を生成します。色数値は、リスト形式で入力しなければなりません。 list-rgb 無しで使われると、gs:set-paint で指定された現在の色が使われます。
Creates a filled circle. The color numbers must be entered in list form. If no list-rgb is used, the current paint specified with gs:set-paint is used.

§

gs:fill-ellipse

syntax: (gs:fill-ellipse sym-tag int-x int-y int-radius-x int-radius-y [list-rgb])
parameter: sym-tag - The tag group of the ellipse.
parameter: int-x - The X position of the ellipse center.
parameter: int-y - The Y position of the ellipse center.
parameter: int-radius-x - The radius of the ellipse.
parameter: int-radius-y - The radius of the ellipse.
parameter: list-rgb - The fill color as a list of 3 numbers for the rgb components.


塗りつぶした楕円を生成します。色数値は、リスト形式で入力しなければなりません。 list-rgb 無しで使われると、gs:set-paint で指定された現在の色が使われます。
Creates a filled ellipse. The color numbers must be entered in list form. If no list-rgb is used, the current paint specified with gs:set-paint is used.

§

gs:fill-polygon

syntax: (gs:fill-polygon sym-tag list-points [list-color])
parameter: sym-tag - The tag group of the polygon.
parameter: list-points - The list of x and y coordinates of the points.


list-points で見つかったポイントで多角形を描画し、 gs:set-paint で設定された現在の色か list-color で与えられるオプションの色で塗りつぶします。
Draws a polygon with the points found in list-points and fills it with the current color set with gs:set-paint or the optional color given in list-color.

Example:
 (gs:fill-polygon 'P '(1 0 2 2 3 0))

 (gs:fill-polygon 'P '(1 0 2 2 3 0) gs:gray)
例は、ポイント 1,0, 2,2, 3,0 で、 下(訳注:原文は上です)が先端の三角形を描き、 それをgs:set-paintで設定された現在の色で塗りつぶすでしょう。 二番目の例は、gs:set-paintで設定された現在の色にかかわらず、灰色の三角形を塗りつぶします。
The example will fill an upwards pointing triangle with the points 1,0, 2,2 and 3,0 and fill it with the current color set with gs:set-paint. The second example paints a gray triangle regardless of the current color set with gs:set-paint.

§

gs:fill-rect

syntax: (gs:fill-rect sym-tag int-x int-y int-width int-height [list-rgb])
parameter: sym-tag - The tag group of the rectangle.
parameter: int-x - The X position of the top left corner.
parameter: int-y - The Y position of the top left corner.
parameter: int-width - The width of the rectangle.
parameter: int-height - The height of the rectangle.
parameter: list-rgb - The fill color as a list of 3 numbers for the rgb components.


塗りつぶした長方形を生成します。色数値は、リスト形式で入力しなければなりません。 list-rgb 無しで使われると、gs:set-paint で指定された現在の色が使われます。
Creates a filled rectangle. The color numbers must be entered in list form. If no list-rgb is used, the current paint specified with gs:set-paint is used.

§

gs:fill-round-rect

syntax: (gs:fill-round-rect sym-tag int-x int-y int-width int-height int-arc-width int-arc-height [list-rgb])
parameter: sym-tag - The tag group of the round rectangle.
parameter: int-x - The X position of the top left corner.
parameter: int-y - The Y position of the top left corner.
parameter: int-width - The width of the rectangle.
parameter: int-height - The height of the rectangle..
parameter: int-arc-width - The width of the corner rectangle.
parameter: int-arc-height - The height of the corner rectangle.
parameter: list-rgb - The outline color as a list of 3 numbers for the rgb components.


角を丸めた長方形を塗りつぶします。丸めは、丸める円弧を内包する長方形で指定されます。
Paints a rectangle shape with round corners. The rounding is defined by the rectangle enclosing the rounding arc. (訳注: list-rgb 無しで使われると、gs:set-paint で指定された現在の色が使われます。)


§

gs:find-text

syntax: (gs:find-text sym-id str-text sym-action [str-direction])
parameter: sym-id - The name of the textr area or text pane.
parameter: str-text - The searching text.
parameter: sym-action - A optional action to peform after find-text.
parameter: str-direction - The optional direction string "next" (default) or "previous".


(訳注:sym-id で指定された)テキスト・パネルを現在位置(caret position)から、 オプションの方向次第で前方またはへ検索します (訳注:オプションの方向は、str-direction"next""previous"で指定します)。 検索語見つかったテキストは、ハイライトされます。 指定されている(訳注:オプションではなく必須の)sym-action に対して、 テキスト・パネルの ID と見つかった位置もしくは -1 を持ったイベントが起こります。 (訳注:原文では、テキスト・エリアでも使えるとありますが、テキスト・パネルだけのようです。 検索後の現在位置(caret position)は、 検索位置(検索語の先頭)もしくは、テキストの終了を示す -1 になります。)
The text area or text pane will be searched starting at the current caret position forward or backwards depending on the optional direction field. After the search the found text is highlighted. If the optional sym-action is specified an event containing the id of the text area or pane and found position or -1 will be fired.

§

gs:frame

syntax: (gs:frame sym-id int-x int-y int-width int-height [str-title boolean-visible])
parameter: sym-id - The name of the frame window.
parameter: int-x - The X position of the top left window corner.
parameter: int-y - The Y position of the top left windows corner.
parameter: int-width - The width of the window frame.
parameter: int-height - The height of the windows frame.
parameter: str-title - The optional title of the window.
parameter: boolean-visible - The optional flag with a value of true or nil for the visibility of the window.


(訳注:sym-id で指定されたフレームを生成します。)
最初、全てのウィジェットを追加するまでフレームは可視化されません。 boolean-visible が指定されない時は、nil になります。 フレームのデフォルトのレイアウトは、一セルのグリッド・レイアウトのように振る舞います。 レイアウトを変更するには、 set-flow-layoutset-border-layoutset-grid-layout を使って下さい。
Initially the frame should not be visible until all widgets are added to it. When no flag for visibility is specified nil is assumed. The default layout of a frame behaves like a grid layout with one cell. Use the set-flow-layout, set-border-layout and set-grid-layout to change the layout.

§

gs:get-bounds

syntax: (gs:get-bounds sym-id)
parameter: sym-id - The id of the component for which to get the list of bounding values.

return: The bounding list (x y width height)



(訳注:sym-id で指定されたコンポーネントの領域値リスト(X位置 Y位置 幅 高さ)を返します。)

§

gs:get-fonts

syntax: (gs:get-fonts)

return: A list of family names for fonts on the current system.



(訳注:システムに登録されているフォント名を取得します。)
多くのフォントをロードしているシステムではかなりの時間を取るので、 関数の呼び出しは、一回のみにとどめておくべきです。 変数 gs:fonts には、 gs:get-fonts 呼び出しで得られたフォントのリストと同じものが入っています。
The function should be called only once because it may take considerable time in a system loaded with many fonts. The variable gs:fonts contains the same list of fonts originally returned by a call to gs:get-fonts.

§

gs:get-font-metrics

syntax: (gs:get-font-metrics sym-id str-text)

return: A list of the two values for width and height in pixels.



sym-id に現在セットされているフォントで str-text の文字列を表示した時の大きさを (訳注:リスト(幅 高さ)で)返します。 変数 gs:font-metrics には、 gs:get-font-metrics 呼び出しで得られたリストと同じものが入っています。
The font metrics for the currently set font in sym-id are returned as a list of width and height in pixels when displaying the string in str-text. After the function call the variable gs:font-metrics contains the same list of values as originally returned by the call to gs:get-font-metrics.

§

gs:get-instruments

syntax: (gs:get-instruments)

return: A list of instrument names in the default MIDI soundbank.



(訳注:soundbank に登録されている楽器を取得します。)
大きな soundbank をロードしているシステムではかなりの時間を取るので、 関数の呼び出しは、一回のみにとどめておくべきです。 変数 gs:instruments には、 gs:get-instruments 呼び出しで得られた楽器のリストと同じものが入っています。
The function should be called only once because it may take considerable time in a system loaded with a big soundbank. The variable gs:instruments contains the same list of instruments originally returned by a call to gs:get-instruments.

§

gs:get-screen

syntax: (gs:get-screen)

return: A list of screen width, height and resolution of the main computer screen.



(訳注:使用しているディスプレイのスクリーン・パラメータをリスト(幅 高さ 解像度)で返します。)
一度 gs:get-screen を呼び出した後、 スクリーン・パラメータは、変数 gs:screen で見ることができます。
After calling the gs:get-screen once the screen parameters are also available in the variable gs:screen.

§

gs:get-selected-text

syntax: (gs:get-selected-text sym-id sym-action)
parameter: sym-id - The name of the component from which to get the selected text.
parameter: sym-action - The symbol of the event handler which will receive the selected text.


(訳注:sym-id で指定されたコンポーネントにおいて選択されているテキストを取得します。)

§

gs:get-text

syntax: (gs:get-text sym-id [sym-action])
parameter: sym-id - The name of the component from which to get the text.
parameter: sym-action - The optional symbol of the event handler which will receive the text.


(訳注:sym-id で指定されたコンポーネントからテキストを取得します。)
sym-action が指定されていないなら、関数はテキストが入力されるまで止まっています。 (訳注:関数から)戻った後、テキストは、変数 gs:text からでも利用できます。 sym-action が指定されているなら、 関数は、直ちに戻り、テキストを含んだ sym-action イベントが起こります。
If no sym-action is specified the function will block until the text is returned. After return the text is also available in the variable gs:text. If sym-action is specified the function will return immediately and a sym-action event is fired containing the text.

§

gs:get-text-position

syntax: (gs:get-text-position sym-id)
parameter: sym-id - The name of the text component for which the line and column position is returned.

return: A list of line and column position of the text caret.



(訳注:sym-id で指定されたテキスト・コンポーネントのカーソル位置のリスト(行 列)返します。 このリストは、gs:goto-textで使えます。)

§

gs:get-version

syntax: (gs:get-version)

return: The version number of newLISP-GS running.



(訳注:走っている newLISP-GS のバージョンを取得します。戻り値の型は、float です。)
一度 gs:get-version を呼び出した後、バージョン番号は gs:version からも利用できます。
After calling the gs:get-version once the version number is also available in gs:version.

§

gs:goto-text

syntax: (gs:goto-text sym-id int-row int-column)
parameter: sym-id - The name of the text widget.
parameter: int-row - The row number where to place the cursor.
parameter: int-column - The column number where to place the cursor.


(訳注:sym-id で指定されたテキスト・ウィジェットのカーソル位置を int-rowint-column 列に設定します。)

§

gs:hide-tag

syntax: (gs:hide-tag sym-tag [boolean-repaint])
parameter: sym-tag - The tag of the group to hide.
parameter: boolean-repaint - An optional flag to indicate if repainting is required (default is true).


(訳注:sym-tag で指定された 2Dグラフィックス・オブジェクトを隠します。 オプションの boolean-repainttrue なら、再描画が要求されます。)

§

gs:image-button

syntax: (gs:image-button sym-id sym-action str-icon-path [str-down-icon-path [int-width int-height]])
parameter: sym-id - The name of the image button.
parameter: sym-action - The name of the event handler.
parameter: str-icon-path - The path for an image icon.
parameter: str-down-icon-path - The path for a pressed down image icon.
parameter: int-width - The optional width of the image button.
parameter: int-height - The optional height of the image button.


(訳注:sym-id で指定されたイメージ・ボタンを str-icon-path の画像を使って生成します。 オプションでボタンが押された時の画像を str-down-con-path に指定できます。
 イベント・ハンドラは、次のように記述します:
(define (button-action id)
    (println "id:" id)
)
 )

§

gs:image-label

syntax: (gs:image-label sym-id str-icon-path [str-align])
parameter: sym-id - The name of the label.
parameter: str-ucon-path - A string with the icon file path.
parameter: str-align - An optional alignment "left", "center" or "right", "leading", "trailing", "bottom" or "top".


(訳注:sym-id で指定されたイメージ・ラベルを str-ucon-path の画像を使って生成します。)

§

gs:init

syntax: (gs:init [int-port str-host [bool-manual]])
parameter: int-port - The optional guiserver server port.
parameter: str-host - The optional remote host of the guiserver.


(訳注:newLISP-GS を初期化します。)

§

gs:insert-list-item

syntax: (gs:insert-list-item sym-list-combo str-text int-index [str-text int-index])
parameter: sym-list-combo - The name of the combo box or list box from which entries are removed.
parameter: str-text - The text of the list or combo box item to insert.
parameter: int-index - The index of an entry to add to the list or combo box.


(訳注:sym-list-combo で指定されたコンボ・ボックスかリスト・ボックスに str-text の項目を追加します。) int-index0 の時、項目は先頭に挿入されます。 int-index が 項目数以上の時、項目は最後に挿入されます。
When specifying an index of 0 the first item gets inserted at the beginning. When specifying an index equal or greater to the number of items in the list, the item is added at the end.

§

gs:insert-tab

syntax: (gs:insert-tab sym-tabbed-pane sym-component [str-text [int-index [str-icon-path]]])
parameter: sym-tabbed-pane - The name of the tabbed pane.
parameter: sym-component - The name of the component to insert as a tab.
parameter: str-text - The optional text on the tab.
parameter: int-index - The optional index where to insert the new tab.
parameter: str-icon-path - The file path to an optional icon.
(訳注:sym-tabbed-pane で指定されたタブ・パネルに タブ sym-component を挿入します。)

§

gs:insert-text

syntax: (gs:insert-text sym-id str-text int-position)
parameter: sym-id - The name of the text component.
parameter: str-text - The text to insert.
parameter: int-position - The offset position where to insert the text.
(訳注:sym-id で指定されたテキスト・コンポーネントに str-text の文字列を挿入します。)

§

gs:key-event

syntax: (gs:key-event sym-id sym-action)
parameter: sym-id - The id of the component to register the action handler.
parameter: sym-action - The symbol of the action handler.


システムのどんなコンポーネントでも不特定キーイベントハンドラを登録するには、gs:key-event を使うことができます。 バージョン 1.05 の newLISP-GS 以来、これは、 一般イベント関数を使って既にキー・イベントを処理しているテキスト・ウィジェットを含有します。 gs:key-event で、第二ハンドラ関数をテキスト・ウィジェット用に登録できます。 どちらの関数も各々イベントを起こします。
gs:key-event can be used to register a general unspecific key event handler for any component in the system. Since version 1.05 of newLISP-GS this also includes text widgets, which already handle key events using their normal event handler function. With gs:key-event a second handler function can be registered for text widgets. Both functions will fire on their respective events.

コンポーネントは、次のキーイベントタイプを返答します:"pressed", "released", "typed"
Components respond to the following key event types: "pressed", "released", "typed".

Example:
 (define (key-action id type code modifiers)
     (println "id:" id " type:" type " key code:" code " modifiers:" modifiers)
 )
例は、アプリケーションが始まった端末/シェルに全キー・イベント・パラメータを表示するハンドラを示しています。
The example shows a handler which prints all key event parameters to the terminal/shell window where the applicaton was started.

キーイベントを動作させるために、 キー・アクション・ハンドラを登録したコンポーネントが入力フォーカスを持っていなければなりません。 コンポーネントに入力フォーカスをセットするのに、"gs:request-focus" を使って下さい。
In order for key events to work, the component for which a key action handler is registered must have the input focus. Use "gs:request-focus" to set the input focus for the component.

§

gs:label

syntax: (gs:label sym-id str-text [str-align [int-width int-height]])
parameter: sym-id - The name of the label.
parameter: str-text - The text to appear on the label.
parameter: str-align - The optional alignment of the text.
parameter: int-width - The optional width of the label.
parameter: int-height - The optional height of the label.


(訳注:sym-id で指定された名前のラベルを生成し、str-text の文字列を表示します。)
(訳注:オプションで)次の配置定数を与えることができます:"left", "center", '"right"", "leading", "trailing", "bottom" and "top"。 各ラベル文字列のデフォルトは、"center" 配置です。
The following alignment constants can be supplied: "left", "center", '"right"", "leading", "trailing", "bottom" and "top". By default each label text is "center" aligned.

§

gs:layout

syntax: (gs:layout sym-container)
parameter: sym-container - The id of the container to lay out.


コンポーネントを展開するためにコンテナにフォーカスを移します。 例えば、コンテナが既に可視化されている時、gs:add-togs:remove-from した後で。
Forces the container to lay out its components again, e.g. after a gs:add-to or gs:remove-from when the container was already visible.

§

gs:load-text

syntax: (gs:load-text sym-id str-path)
parameter: sym-id - The id of the gs:text-pane.
parameter: str-path - The full path name of the file to load.


gs:load-text は、(訳注:sym-id の)gs:text-pane に、 (訳注:str-pathの) パス名で指定されたテキストを、直接ロードします。 ロード中、CR-LF 行終端文字は、自動時にファイルから CR を取り除くことで、LFのみの行終端文字に変換されます。 guiserver の全ての内部操作は、行終端に LF を想定しています。
gs:load-text will load text into a gs:text-pane directly by specifying the path name. During loading, CR-LF line terminators are automatically translated to LF-only line terminators by stripping all CRs from the file. All internal operations of guiserver on text assume LF as a line terminator.

§

gs:listen

syntax: (gs:listen [boolean-flag])
parameter: boolean-flag - Prevent exit on loss of communication.

return: Never returns. Exits the application when the guiserver exits, except when boolean-flag is true.



(訳注:GUI によるユーザ入力待ち受けを開始します。 boolean-flagtrue の時を除いて、guiserver 終了時にアプリケーションも終了します。)

§

gs:list-box

syntax: (gs:list-box sym-id sym-action [str-item-1 ...])
parameter: sym-id - The name of the list box.
parameter: sym-action - The name of the event handler.
parameter: str-item - Zero, one or more text entries in the list box.
syntax: (gs:list-box sym-id sym-action [list-str-items])
parameter: sym-id - The name of the list box.
parameter: sym-action - The name of the event handler.
parameter: list-str-items - Zero, one or more text entries in a list.


(訳注:sym-id で指定されたリストボックスを生成します。)
リストボックスは、マウスでクリックされるか、[enter] きーが押された時、 次のパラメータをイベント・ハンドラに渡します:
The listbox when clicked with the mouse, or when the [enter] key is presses, will pass the following parameters to the event handler:

id - the id string of the list box
index - the zero offset index of the highlighted listbox entry
item - the string of the highlighted listbox entry
click-count - the number of times the mouse has been clicked


(訳注:イベント・ハンドラは、次のように記述します:
(define (list-action id idx item click-count)
    (println "id:" id " index:" idx " item:" (base64-dec item) " click-count:" click-count)
)
index は整数で、選択された項目の順番(0 から始まる)が入ります。
item は base64 エンコードされた文字列で、選択された項目(str-item の内容)が入ります。
click-count は、ダブル・クリック等の判定に使います。
 )

§

gs:message-dialog

syntax: (gs:message-dialog sym-parent-frame str-title str-message [str-type [str-icon-path]])
parameter: sym-parent-frame - The symbol name of the parent frame.
parameter: str-title - The title of the message box.
parameter: str-message - The message in the message box.
parameter: str-type - The type of the message box.
parameter: str-icon-path - The optional path for an icon.


(訳注:メッセージボックスを表示します。)
(訳注:str-type オプションで指定できる)メッセージボックスのタイプは、次のうちの一つです: "error", "information", "warning", "question", "plain"。 ダイアログを閉じると、メッセージ・ダイアログを起動した関数に戻ります。
The type of the message box can be one of: "error", "information", "warning", "question", "plain". The function initiating the message-dialog will return when the dialog is closed.

§

gs:menu

syntax: (gs:menu sym-id str-text)
parameter: sym-id - The name of the menu.
parameter: str-text - The title string of the menu.


(訳注:sym-id で指定されたメニューを生成します。)

§

gs:menu-popup

syntax: (gs:menu-popup sym-id str-text)
parameter: sym-id - The name of the menu.
parameter: str-text - The title string of the menu.


(訳注:sym-id で指定されたポップアップ・メニューを生成します。)

§

gs:menu-bar

syntax: (gs:menu-bar sym-frame [sym-menu-1 ...])
parameter: sym-frame - The name of the frame hosting the menu bar.
parameter: sym-menu - Zero or more symbol names of menus to be positioned on the menu bar.


(訳注:sym-frame で指定されたフレームに sym-menu-1 以下の gs:menu で作成したメニューを設定します。)

§

gs:menu-item

syntax: (gs:menu-item sym-id sym-action str-text)
parameter: sym-id - The name of the menu item.
parameter: sym-action - The name of the event handler.
parameter: str-text - The text to appear for the menu item.
(訳注:sym-id で指定されたメニュー項目を生成します。 gs:add-to を使って、gs:menugs:menu-popup で作成したメニューに追加して、使います。)

§

gs:menu-item-check

syntax: (gs:menu-item-check sym-id sym-action str-text [bool-selected])
parameter: sym-id - The name of the menu item.
parameter: sym-action - The name of the event handler.
parameter: str-text - The text to appear for the menu item.
parameter: bool-selected - An optional flag indicating the selection state true or nil (default).
(訳注:sym-id で指定されチェック付きメニュー項目を生成します。 gs:add-to を使って、gs:menugs:menu-popup で作成したメニューに追加して、使います。)

§

gs:midi-bpm

syntax: (gs:midi-bpm [int-bpm [int-resolution]]])
parameter: int-bpm - Beats per minute pay speed. Default is 120 BPM.
parameter: int-resolution - Ticks per beat. Deafult is 16 ticks per beat;


gs:play-note で音を鳴らすか、gs:play-sequence で演奏する時の速さを1分あたりのビート (BPM) で設定します。
Sets the speed of playing a notes with with either gs:play-note or playing a sequence with gs:play-sequence in beats per minute (BPM).

gs:midi-bpm を使う前の、デフォルトの速さは、120 BPM に設定されて、 1秒あたり2拍、1拍はデフォルトの分解能 16チックの四分音符相当です。
Before using gs:midi-bpm the default speed is set to 120 BPM, which corresponds to two beats per second, where each beat corresponds to a quarter note of 16 ticks default resolution.

PMパラメタがシーケンサの再生速度を制御している間、解決を系列創造自体のパラメタであり、最初の道を加えている呼び出しの前に設定しなければなりません。 BPMパラメータがシーケンサの演奏速度を制御している間、分解能はシーケンス作成のパラメータで、最初のt gs:add-track が呼び出される前に設定されていなければなりません。
While the BPM parameter controls the play-back speed of the sequencer, the resolution is a parameter of the sequence creation itself and must be set before the first gs:add-track call.

四分音符あたり 16チックのプリセット分解能は、設定できる最高値で、全てのアプリケーションに、十分な値です。
The preset resolution of 16 ticks per quarter note is the highest which can be set and should be sufficient for all applications.



§

gs:midi-close

syntax: (gs:midi-close)


MIDI サブシステムを閉じます。
Shut down the MIDI subsystem.

§

gs:midi-init

syntax: (gs:midi-init [str-file-path])
parameter: str-file-path - The optional file path for a soundbank file.


MIDI サブシステムを初期化します。soundbank ファイルが指定されているなら、それがロードされ、そうでなければ、デフォルトで組込シンセサイザーの soundbank がロードされます。
Initialize the MIDI subsystem. If a soundbank file is specified load it, else load the built-in synthesizer's default soundbank.

デフォルトの soundbank を使わない時は、gs:midi-patch 宣言文で使う正確な楽器名を得るために、最初に関数 gs:get-instruments を使って下さい。 MS Windows 上で、デモ・ファイル midi-demo.lspmidi2-demo.lsp を試すために使われる soundbank は、ここ http://java.sun.com/products/java-media/sound/soundbanks.html にあるミッドサイズ の soundbank です。 この soundbank は、 Mac OS X のデフォルト JRE インストール で使えるのと同等の楽器名を持っています。 現在は、soundbank の最初の 128楽器のみが newLISP-GS でアクセス可能です。
When not using the default soundbank, the function gs:get-instruments should be used first to find out the correct naming of instruments for the gs:midi-patch statements. The soundbank used for testing the demo files midi-demo.lsp and midi2-demo.lsp on MS Windows is the midsize soundbank available here: http://java.sun.com/products/java-media/sound/soundbanks.html This soundbank has equivalent named instruments to those used in the Mac OS X default JRE installation. Currently only the first 128 instruments in a soundbank are accessed by newLISP-GS.

§

gs:midi-patch

syntax: (gs:midi-patch str-instrument [int-channel])
parameter: str-instrument - The name of the instrument to attach to a channel.
parameter: int-channel - The channel for the instrument, default is 0.


現在の soundbank から、指定されたチャンネルか、チャンネルが指定されない時のチャンネル 0 に一つの楽器が割り当てられます。
An instrument from the current soundbank is attached to a specific channel or to channel 0 if no channel is specified.

Example:
 (gs:midi-patch (find "Electric Grand" gs:instruments) 0)
gs:instruments 変数に楽器のリストを収めておくために、 gs:get-instruments を、早いうち、例えば、gs:midi-initの後とかに、呼び出しておくべきです。
In order for the gs:instruments variable to contain a list of instruments, gs:get-instruments must have been called earlier, i.e. after gs:midi-init.

§

gs:mouse-clicked

syntax: (gs:mouse-clicked sym-canvas sym-action [boolean-tags])
parameter: sym-canvas - The id of the canvas to register the action handler.
parameter: sym-action - The symbol of the action handler.
parameter: boolean-tags - A true to indicate checking for tags.


(訳注:sym-canvas で指定されたカンバス上のマウス・クリックによるイベント・ハンドラを設定します。)
boolean-tagstrue なら、アクション・イベントは、マウスのX、Y座標から得られる全てのタグのリストを運びます。
If boolean-tags is true, the action event will carry a list of all tags which contained the X,Y coordinates of the mouse.
(訳注:イベント・ハンドラは、次のように記述します:
(define (mouse-action x y button cnt mods tags)
  (println " x:" x " y:" y " button:" button " count:" cnt " mods:" mods " tags:" tags)
)
x, y は、カンバス上のマウスの位置で、原点は、カンバスの左上です。
button は、クリックされたマウスボタンを示しています。1 が 左ボタン、2 が 真ん中(ホイール)ボタン、3 が右ボタンです。
cnt は、クリック数です。ダブルクリックなどの判定に使います。
mods は、各ビットに特殊キーやマウス・ボタンの状態が割り当てられていて、1 が押された状態です。
各ビットの内容は、以下の通りです。例えば、Shiftキーを押しながら左クリックすると 17 になります。
bit43210
keyAltCtrlShift
mouse buttonLeftMiddleRight
tags は、マウスをクリックした位置にあるオブジェクトの全タグのリストです。
 )

§

gs:mouse-dragged

syntax: (gs:mouse-dragged sym-canvas sym-action)
parameter: sym-canvas - The id of the canvas to register the action handler.
parameter: sym-action - The symbol of the action handler.


(訳注:sym-canvas で指定されたカンバス上のマウス・ドラッグによるイベント・ハンドラを設定します
 イベント・ハンドラは、次のように記述します:
(define (mouse-action x y unknown mods)
  (println " x:" x " y:" y " unknown:" unknown " mods:" mods)
)
unknown 以外の各引数の内容は、gs:mouse-clickedを参照して下さい。
 )

§

gs:mouse-event

syntax: (gs:mouse-event sym-id sym-action)
parameter: sym-id - The id of the component to register the action handler.
parameter: sym-action - The symbol of the action handler.


汎用マウス・イベント・ハンドラを登録するために、システムのどのコンポーネントでも gs:mouse-event を使うことができます。 コンポーネントは、次のタイプ:"pressed", "released", "clicked" を返答します。
gs:mouse-event can be used to register a general unspecific mouse event handler for any component in the system. Components respond to the following types: "pressed", "released", "clicked",

Example:
 (define (mouse-action id type x y button cnt mods)
     (println "id:" id " type:" type " x:" x " y:" y " button:" button " count:" cnt " mods:" mods)
 )
(訳注:type 以外の各引数の内容は、gs:mouse-clickedを参照して下さい。)
例は、アプリケーションが開始した端末/シェルに全マウス・イベント・パラメータを表示するハンドラを示しています。
The example shows a handler which prints all mouse event parameters to the terminal/shell window where the applicaton was started.

§

gs:mouse-moved

syntax: (gs:mouse-moved sym-canvas sym-action)
parameter: sym-canvas - The id of the canvas to register the action handler.
parameter: sym-action - The symbol of the action handler.
parameter: boolean-tags - A true to indicate checking for tags.


(訳注:sym-canvas で指定されたカンバス上のマウス・ムーブによるイベント・ハンドラを設定します。)
boolean-tagstrue なら、アクション・イベントは、マウスのX、Y座標から得られる全てのタグのリストを運びます。
If boolean-tags is true, the action event will carry a list of all tags which contained the X,Y coordinates of the mouse.
(訳注:イベント・ハンドラは、次のように記述します:
(define (mouse-action x y tags)
  (println " x:" x " y:" y " tags:" tags)
)
(訳注:各引数の内容は、gs:mouse-clickedを参照して下さい。)
 )

§

gs:mouse-pressed

syntax: (gs:mouse-pressed sym-canvas sym-action [boolean-tags])
parameter: sym-canvas - The id of the canvas to register the action handler.
parameter: sym-action - The symbol of the action handler.
parameter: boolean-tags - A true to indicate checking for tags.


(訳注:sym-canvas で指定されたカンバス上のマウス・ボタンが押されたことによるイベント・ハンドラを設定します。)
boolean-tagstrue なら、アクション・イベントは、マウスのX、Y座標から得られる全てのタグのリストを運びます。
If boolean-tags is true, the action event will carry a list of all tags which contained the X,Y coordinates of the mouse.
(訳注:イベント・ハンドラは、次のように記述します:
(define (mouse-action x y button mods tags)
  (println " x:" x " y:" y " button:" button " mods:" mods " tags:" tags)
)
(訳注:各引数の内容は、gs:mouse-clickedを参照して下さい。)
 )

§

gs:mouse-released

syntax: (gs:mouse-released sym-canvas sym-action [boolean-tags])
parameter: sym-canvas - The id of the canvas to register the action handler.
parameter: sym-action - The symbol of the action handler.
parameter: boolean-tags - A true to indicate checking for tags.


(訳注:sym-canvas で指定されたカンバス上のマウス・ボタンが離されたによるイベント・ハンドラを設定します。)
boolean-tagstrue なら、アクション・イベントは、マウスのX、Y座標から得られる全てのタグのリストを運びます。
If boolean-tags is true, the action event will carry a list of all tags which contained the X,Y coordinates of the mouse.
(訳注:イベント・ハンドラは、次のように記述します:
(define (mouse-action x y button mods tags)
  (println " x:" x " y:" y " button:" button " mods:" mods " tags:" tags)
)
(訳注:各引数の内容は、gs:mouse-clickedを参照して下さい。)
 )

§

gs:mouse-wheel

syntax: (gs:mouse-wheel sym-canvas sym-action)
parameter: sym-canvas - The id of the canvas to register the action handler.
parameter: sym-action - The symbol of the action handler.
(訳注:sym-canvas で指定されたカンバス上のマウス・ホイール操作によるイベント・ハンドラを設定します。
 イベント・ハンドラは、次のように記述します:
(define (mouse-action x y wheel)
  (println " x:" x " y:" y " wheel:" wheel)
)
x, y は、カンバス上のマウスの位置で、原点は、カンバスの左上です。
wheel は、回転量で、手前に回すと +、反対方向は、- です。
 )

§

gs:move-tag

syntax: (gs:move-tag sym-tag int-dx int-dy [boolean-repaint])
parameter: sym-tag - The tag of the group of objects to move.
parameter: int-dx - The distance to move on the X-axis.
parameter: int-dy - The distance to move on the Y-axis.
parameter: boolean-repaint - An optional flag to indicate if repainting is required (default is true).


(訳注:sym-tag で指定されたオブジェクトを移動します。)
gs:move-tag は、実際に描画オブジェクトの内部データを変更する唯一のタグ操作です。 gs:translate-taggs:scale-taggs:rotate-taggs:shear-tag のような他のタグ操作は、描画する際にオブジェクト座標を変形するだけです。
gs:move-tag is the only tag operation which actually changes the internal data of a drawn object. All other tag operations like gs:translate-tag, gs:scale-tag, gs:rotate-tag and gs:shear-tag will transform object coordinates only for drawing.

§

gs:mute-track

syntax: (gs:mute-track int-number [boolean-on-off])
parameter: int-number - The number of the track starting with 0 for the first. Default is true.
parameter: boolean-on-off - The track will be muted with a value of true


(訳注:int-number で指定されたトラックをミュート(消音)します。)
true 以外の如何なる値も、トラックのミュートを解除します。 トラックをミュートすることは、音楽製作中、実際に役立ちます。 gs:play-sequenceを使ってシーケンスを開始した時のみ、トラックのミュートが可能になります。 トラックを完全にミュートするためには、 gs:mute-track 宣言文が gs:play-sequece 宣言文の後に、正しく来るべきです。
Any other value than true will unmute the track again. Muting tracks is practical during music development. The track can only be muted when th sequence has benn started using gs:play-sequence. To completely mute a track the gs:mute-track statement should come right after the gs:play-sequece statement.

§

gs:no-action

syntax: (gs:no-action)


無動作のハンドラを定義したいウィジェットの sym-action として指定します。
Specify as sym-action for widgets where no action handler is defined.

§

gs:open-file-dialog

syntax: (gs:open-file-dialog sym-parent-frame sym-action [str-directory [str-mask str-description]])
parameter: sym-parent-frame - The parent frame of the file dialog.
parameter: sym-action - The handler function symbol.
parameter: str-directory - The initial directory to show.
parameter: str-mask - An optonal string mask.
parameter: str-description - An optional mask description.


(訳注:オープン・ファイル・ダイアログを起動します。
 str-mask に複数の拡張子を指定する場合は、スペースで区切ります。
 イベント・ハンドラは、次のように記述します:
(define (openfile-action id op file)
  (println "id:" id " op:" op " file:" (base64-dec file))
)  
op は、文字列で "open" が入ります。
file は base64 エンコードされた文字列で、ファイル名のフルパスが入ります。
 )

§

gs:panel

syntax: (gs:panel sym-id [int-width int-height])
parameter: sym-id - The name of the panel.
parameter: int-width - The optional width of the panel.
parameter: int-height - The optional height of the panel.


(訳注:sym-id で指定されたパネルを生成します。)
パネルは、デフォルトでフロア・レイアウトです。 フロア・レイアウトでは、サイズ指定のないボタンは、ボタン上のテキスト表示に必要なサイズになります。 レイアウトを変更するには、関数 set-flow-layoutset-grid-layout を使って下さい。
Panels have a flow layout by default. In a flow layout an unsized button will assume the natural size necessary to display the text on it. To change the layout use the set-flow-layout or set-grid-layout functions.

§

gs:paste-text

syntax: (gs:paste-text sym-id [str-text])
parameter: sym-id - The name of the text component in which to paste text.
parameter: str-text - An optional text string to paste instead of the clipboard contents.


(訳注:sym-id で指定されたテキスト・コンポーネントにテキストをペーストします。)
sym-id が選択中の文字列を持っていれば、そのテキストを置き換え、 そうでなければ、現在のカーソル位置(caret position)にテキストを挿入します。 str-text にテキストがなければ、クリップボードから取られます。
If the sym-id contains selected text, this text gets replaced, otherwise the text is inserted at the current caret position. If no text is given in str-text, the text is taken from the clipboard.

§

gs:play-note

syntax: (gs:play-note int-key [int-duration [int-velocity [int-channel [int-bend]]]])
parameter: int-key - The note or midi key 0 to 127.
parameter: int-duration - The duration of the note in ticks, default is 16 for one beat or quarter note.
parameter: int-velocity - The velocity/volume of the note between 0 and 127, default is 64.
parameter: int-channel - The channel through which to play the note from 0 to 15, default is 0.
parameter: int-bend - The optional note bend to tune the note lower or higher from -8192 to 8191.


(訳注:int-key で指定された音を鳴らします。)
gs:play-note を使う前に、gs:midi-init を使って MIDI システムを初期化して下さい。 音(note)のキー(key)は、1ステップで半音上がります。 キー 60 が、中央ハ です。 (訳注:音の長さ(duration)のデフォルトは、16 で四分音符相当です。 テンポ(speed)は、gs:midi-bpm で設定して下さい。) 音の強さ(velocity)は、通常、音量か輝き(brightness)で両方かもしれません、 それは、楽器でその音を弾いた時の速さだからです。 チャンネルのデフォルトは 0 で、 gs:midi-patch を使って違う楽器に割り当てを違う楽器に変更していなければ、 ピアノが割り当てられています。
Before using gs:play-note, gs:midi-init should be used to initialize the MIDI system. The key of the note increases in half-tone steps. The key 60 corresponds to a Middle-C. The velocity of the note is usually it's volume and/or brightness, i.e. the speed with which a key was pressed on an instrument. The channel is 0 by default and assigned to a Piano instrument unless the function gs:midi-patch has been used to change assignment to a different instrument.

MS Windows といくつかの Linux や他の UNIX では、MIDI soundbank ファイルが、デフォルトでインストールされていません。 soundbank のダウンロードやインストールの指示については、http://java.sun.com/products/java-media/sound/soundbanks.html へ行って下さい。 デモ・ファイル mide-demo.lspmidi2-demo は、ミドルサイズの soundbank を使っています。 Mac OS X では、デフォルトでインストールされています。 ベンド(bend)パラメータのデフォルトは、0 で、調律無しです。 マイナスの値は -8192 まで下げされ、音の低い方へ調律します。プラスの値は 8191 までで、音を高い方へ調律します。 続くコードは、完全な例です:
On MS Windows and some Linux or other UNIX no MIDI soundbank files are installed by default. Goto http://java.sun.com/products/java-media/sound/soundbanks.html for instructions how to download and install a soundbank. For the demo files mide-demo.lsp and midi2-demo the midsize quality soundbank was used. On Mac OS X a soundbank is installed by default. The default for the bend parameer is 0 for no bend. Negative values down to -8192 tune the note lower. Positive values up to 8191 tune the note higher. The following code is a complete example:

Example:
 ; load Guiserver
 (load (append (env "NEWLISPDIR") "/guiserver.lsp"))
 (gs:init)

 ; play a chromatic scale on the default instrument (piano)
 ; each note a 16th note of 4 ticks and a moderate volume 

 (gs:midi-init)
 (gs:midi-patch "Piano" 0)
 (for (key 24 95) (gs:play-note key 4 95 0))
 (sleep 2000) ; wait until playing has finished
 (gs:midi-close)
二番目の例は、int-bend パラメメータの使用法を示しています:
The second example demonstrated usage of the int-bend parameter:

Example:
 ; play the same note but with different bends below and above the note
 (gs:midi-patch "Violin" 0)
 (for (bend -2024 2024 128)
     (gs:play-note 80 1 95 0 bend))
複数の並列トラックの多重演奏音楽を鳴らすには、 関数 gs:add-track の完全なコード例を見て下さい。
To play polyphone music of multiple parallel tracks see the function gs:add-track for a complete code example.

§

gs:play-sequence

syntax: (gs:play-sequence [int-start [int-loop-count [int-start-loop [int-end-loop]]])
parameter: int-start - The starting point in the sequence in ticks. Default is 0 for the beginning.
parameter: int-loop-count - The number of repetitions for looping. Default is 0 for no looping.
parameter: int-start-loop - The start of the loop to play in ticks. Default is 0.
parameter: int-end-loop - The end of the loop in ticks. Default is -1 for the end.


(訳注:gs:add-track で登録した全トラックを演奏します。) 全パラメータが、オプションです。 パラメータ無しで、シーケンスの全トラックが開始から終了まで繰り返し無し(ループ・カウント 0 )で演奏されます。 start-loop と end-loop の位置は、全トラックの演奏後のループ演奏用にのみ参照されることに注意して下さい。 シーケンスの演奏を開始した後は、それを止めるために、何時でも、gs:stop-sequence が使えます。 演奏が終了する前か、演奏を止める前に gs:midi-close を使って MIDI システムを止めてはいけません。
All parameters are optional. When no parameters are given all tracks in the sequence are sequenced from start to end with no repetiton (loop count of 0). Note that the start-loop and end-loop positions refer only to loop played after playing the full track. After the sequence started playing gs:stop-sequence can be used to stop it at any time. The midi system should not be closed using gs:midi-close before playing has finished or playing will be cut off.

完全なコード例は、関数 gs:add-track で見て下さい。
See the function gs:add-track for complete code example.

§

gs:play-sound

syntax: (gs:play-sound str-file-path)
parameter: str-file-path - The path and file name of the sound file.


(訳注:str-file-path で指定されたサウンド・ファイルを再生します。)
ほとんどの OS プラットフォームで、.au.wav のサウンド・ファイル形式がサポートされています。
On most OS platforms .au and .wav sound file formats are supported.

§

gs:progress-bar

syntax: (gs:progress-bar sym-id int-min in-max int-initial-value)
parameter: sym-id - The symbols of the progress bar.
parameter: int-min - The minimum value of the slider.
parameter: int-max - The maximum value of the slider.
parameter: int-initial-value - The initial value of the slider.


(訳注:sym-id で指定されたプログレス・バーを生成します。
値の変更には、gs:set-value を使います。 )

§

gs:radio-button

syntax: (gs:radio-button sym-id sym-action [str-text [bool-selected]])
parameter: sym-id - The name of the radio button.
parameter: sym-action - The name of the event handler.
parameter: str-text - The optional text of the radio button.
parameter: bool-seected - An optional flag true or nil (default) indicating the initial state of the radio button.


(訳注:sym-id で指定されたラジオ・ボタンを生成します。
 イベント・ハンドラは、次のように記述します:
(define (radio-action id selected)
    (println "id:" id " selected:" selected)
)
selected は、bool 型です。
 )

§

gs:redo-text

syntax: (gs:redo-text sym-id)
parameter: sym-id - The id of the gs:text-pane where to perform a redo operation.


(訳注:sym-id で指定されたテキスト・パネルをリドゥ動作します。)


§

gs:remove-from

syntax: (gs:remove-from sym-container sym-component [sym-component ...])
parameter: sym-container - The container from which to remove a component.
parameter: sym-component - One or more optional components to remove.


(訳注:sym-id で指定されたコンテナから、sym-component以下のコンポーネントを削除します。)


§

gs:remove-list-item

syntax: (gs:remove-list-item sym-list-combo int-index [int-index ...])
parameter: sym-list-combo - The name of the combo box or list box from which entries are removed.
parameter: int-index - The index of an entry to remove from the list or combo box.


(訳注:sym-list-combo で指定されたコンボ・ボックスやリスト・ボックスから、int-index以下で指定されたエントリを削除します。)
インデックスが 0 の時、一番目のアイテムが削除されます。インデックスがリストの項目数以上の時、最後の項目が削除されます。
When specifying an index of 0, the first item gets removed. When specifying an index equal or greater to the number of items in the list, the item is removed at the end.

§

gs:remove-tab

syntax: (gs:remove-tab sym-tabbed-pane [int-index])
parameter: sym-tabbed-pane - The name of the tabbed pane.
parameter: int-index - The optional index of the tab to remove. The default is 0 for the first tab.


(訳注:sym-tabbed-pane で指定されたタブ・パネルから、int-index以下で指定されたタブを削除します。
int-index が指定されない時は、一番目のタブが削除されます。)

§

gs:request-focus

syntax: (gs:request-focus sym-id [int-tab-index])
parameter: sym-id - The name of the component for which to request focus.
parameter: int-tab-index - The index of a tab for which focus is requested.


(訳注:sym-id で指定されたコンポーネントを強制的にアクティブにします。
タブ・パネルの指定時は、int-tab-index も指定します。)

§

gs:reorder-tags

syntax: (gs:reorder-tags list-tags)
parameter: list-tags - The list of tag symbols or tag string names in the new order of display.


(訳注:list-tags の順序でタグを再配置します。)
再配置自体はカンバスを再描画しませんので、 gs:reorder-tags を使った後、 現在のカンバスを再描画するのに、gs:update を使って下さい。 タグのリストは、タグのシンボルか文字列のどちらかで与えます。 list-tags に無いタグは、消去されます。
The re-ordering itself will not repaint the canvas use gs:update to repaint the current canvas after using gs:reorder-tags. The list of tags can be given as either a list of tags symbols or name strings. Tags not appearing in list-tags will be deleted.

§

gs:rotate-tag

syntax: (gs:rotate-tag sym-tag float theta int-x int-y [boolean-repaint])
parameter: sym-tag - The tag group to rotate.
parameter: float-theta - The rotation angle in degrees (0 - 360).
parameter: int-x - The X-coordinate of the rotation center.
parameter: int-y - The Y-coordinate of the rotation center.
parameter: boolean-repaint - An optional flag to indicate if repainting is required (default is true).


(訳注:sym-tag で指定されたタグを回転します。角度が+なら時計回り、-なら反時計回りです。)
全てのタグ操作のように、複数の gs:rotate-tag 操作は、累積されていきす。
Like all tag operations, multiple gs:rotate-tag operations are cumulative.

§

gs:run-shell

syntax: (gs:run-shell id-text-area str-command str-args)
parameter: idx-text-area - The id of the text area to wich a shell process will be attached.
parameter: str-command - The command string to start the shell process.
parameter: str-args - The arguments of the command (max 8 arguments).


(訳注:idx-text-area で指定されたテキスト・エリアにシェル・プロセスを割り当てます。 V1.52から、str-args が別に必要となっています。)


§

gs:save-file-dialog

syntax: (gs:save-file-dialog sym-parent-frame sym-action [str-directory [str-initial-file [str-mask str-description]]])
parameter: sym-parent-frame - The parent frame of the file dialog.
parameter: sym-action - The handler function symbol.
parameter: str-directory - The initial directory to show.
parameter: str-file - The initial file name.
parameter: str-mask - An optional string mask.
parameter: str-description - An optional mask description.


(訳注:セーブ・ファイル・ダイアログを起動します。
 str-mask に複数の拡張子を指定する場合は、スペースで区切ります。
 イベント・ハンドラは、次のように記述します:
(define (savefile-action id op file)
  (println "id:" id " op:" op " file:" (base64-dec file))
)  
op は、文字列で "save" が入ります。
file は base64 エンコードされた文字列で、ファイル名のフルパスが入ります。
 )

§

gs:save-sequence

syntax: (gs:save-sequence str-file-path)
parameter: str-file-name - The name of the MIDI file to save to.


gs:add-track で作成したシーケンスの内容を MIDI ファイルとして保存します。 ファイルの拡張子は、常に .mid を持つべきです。
Save the contents of a sequence created with gs:add-track to a MIDI file. The file always should have the extension .mid.

gs:save-sequence で生成した MIDI ファイルは、 全て 120 BPM の固定速度で再生することに注意して下さい。 そのため、gs:add-track を使って、録音用のシーケンスを生成する時は、 120 BPM の再生速度用に調節されるべきです。
Note that all MIDI files created with gs:save-sequence will play back at a fixed speed of 120 BPM. Therefore, when creating sequences for recording using gs:add-track, they should be timed for a play-back speed of 120 BPM.

保存された MIDI ファイルの再生速度変えるために、 gs:midi-bpm の第二オプション・パラメータを使って、 解像度(resolution)パラメータを 1 ビート 16 チック のデフォルトから変更できます。
To change the speed for replay from a saved MIDI file the resolution parameter can be chaged from it's default of 16 tick per beat using the second optional parameter of gs:midi-bpm. In this case the resolution parameter should be adjusted before calling gs:add-track the first time.

§

gs:save-text

syntax: (gs:save-text sym-id str-path)
parameter: sym-id - The id of the gs:text-pane.
parameter: str-path - The full path name of the file to save.


この関数は、gs:text-pane のテキストを指定されたパス名に直接書き込みます。 ライン・フィード文字 (ASCII 10) を改行に使います。 WIndows テキスト・ファイルのようにこの動作を望まないなら、代わりに gs:get-text を使って下さい。 プログラムは、テキストをファイルに保存する前に、replace を使って、CR 文字を追加できます。 例えば、 (replace "\n" text "\r\n")
This function will write text back from a gs:text-pane directly by specifying a path name only. Line feed characters (ASCII 10) are used as line terminators. If this behavior is not desired, as is the case with Windows text files, then gs:get-text should be used instead. A program can then add CR characters using a newLISP replace, i.e. (replace "\n" text "\r\n") before saving the text to a file.

§

gs:scale-tag

syntax: (gs:scale-tag sym-tag float-x float-y [boolean-repaint])
parameter: sym-tag - The tag group to scale.
parameter: float-x - The X scaling factor.
parameter: float-y - The Y scaling factor.
parameter: boolean-repaint - An optional flag to indicate if repainting is required (default is true).


gs:scale は、座標系の 0,0 点に比例する描画でスケーリングします。 これは、オブジェクトが中心になければ、スケーリングの際、サイズだけでなく、座標の中心からの距離も変わります。 1.0 より大きいスケーリング・ファクタでスケールアップする時、遠くに離れ、 1.0 より小さいファクタを使って、スケールダウンする時は、中心に近付きます。
gs:scale scales the object to draw relative to the 0,0 point of the coordinate system. This means if a object is not at the center it will not only change in size when scaled but also change the distance to the center point of the coordinate system, moving away when scaling up with scale factor bigger 1.0 and moving closer to the center when scaling down using factors smaller than 1.0.

これは、スケーリングされるオブジェクトが中心からの相対座標で定義されるべきことを意味します。 オブジェクトを正しい位置に置くために、gs:translate-tag コマンドを使うべきです:
This means that objects which will be scaled should be defined in coordinates relative to their center point. Then a gs:translate-tag command should be used to place the object to correct place:

Example:
 (gs:circle 'C 0 0 50)
 (gs:gs:translate-tag 'C 200 100)
 ...
 (gs:scale-tag 'C 1.1 1.1)
この例では、円は、0,0 に定義されていますが、 gs:translate-tag 宣言文のおかげで、200,200 位置に表示されます。 スケーリングした後、円は、大きくなりますが、位置は変わりません。 同様の全てのタグ操作のように、複数の gs:scale-tag 操作は、累積されます。
In the example the circle, although defined for 0,0, will be displayed at the 200,200 position because of the gs:translate-tag statement. When later scaling the circle will get bigger but stay in place. Like all tag operations, multiple gs:scale-tag operations are cumulative.

§

gs:select-list-item

syntax: (gs:select-list-item sym-id str-item [boolean-flag])
parameter: sym-id - The name of the list or combo box.
parameter: str-item - The item to select.
parameter: boolean-flag - An optional flag only for list boxes to force scrolling to the selected entry.


(訳注:sym-id で指定されたリスト・ボックスまたはコンボ・ボックスで、 str-item の項目を選択します。)
コンボ・ボックスでは、オプションの boolean-flag は何ら影響を与えません。 コンボボックスのテキスト変数部には、常に、選択されたエントリが表示されます。 (訳注:オプションの)フラグは、truenil のどちらかを持ちます。
On combo boxes the optional boolean-flag has no effect. The selected entry will always appear as the visible text of the combo box. The flag has either the value true or nil.

§

gs:select-text

syntax: (gs:select-text sym-id int-from [int-to])
parameter: sym-id - The ame of the text component.
parameter: int-from - Start offset of selection.
parameter: int-to - Optional end offset of selection.


(訳注:sym-id で指定されたテキスト・コンポーネントで、 int-fromからのテキストを選択します。)
もし、終了オフセット int-to が与えられないなら、 gs:select-textは、テキストの終了までを選択します。
If no int-to end offset is given, gs:select-text will select to the end of the text.

§

gs:scroll-pane

syntax: (gs:scroll-pane sym-id sym-widget [int-width int-height sym-w-col sum-w-row sym-w-corner])
parameter: sym-id - The name of the scroll pane.
parameter: sym-widget - The component in the scroll pane to be scrolled.
parameter: int-width - The optional width of the scroll pane.
parameter: int-height - The optional height of the scroll pane.
parameter: sym-col - The optional table widget for a custom column header.
parameter: sym-row - The optional table widget for a custom row header
parameter: sym-corner - The optional widget component in the upper left corner.


(訳注:sym-widget で指定されたコンポーネントを sym-id の名前のスクロール・パネルにします。) Example:
 (gs:scroll-pane 'scroll 'data-table 700 600 'col-table 'row-table 'Canvas)


§

gs:set-accelerator

syntax: (gs:set-accelerator sym-menu-item str-keystroke)
parameter: sym-menu-item - The name of the menu item for which an accelerator key is set.
parameter: str-keystroke - A text string identifying the keystroke.


(訳注:sym-menu-item で指定されたメニュー・アイテムを str-keystroke のアクセラレータ・キーに割り当てます。)
キーストローク文字列を生成するのに次のルールが使われます:
The following rules are used to create keystroke strings:

Syntax:
 modifiers* (typedID | pressedReleasedID)
 modifiers := shift | control | ctrl | meta | alt | button1 | button2 | button3
 typedID := typed typedKey
 typedKey := string of length 1 giving Unicode character.
 pressedReleasedID := (pressed | released) key
 key := KeyEvent key code name, i.e. the name following "VK_".
 
Examples:
 "INSERT"
 "control DELETE"
 "alt shift X"
 "alt shift released X"
 "typed a"
 
MacOS X 上の apple キーは、meta キーになることに注意して下さい。 MacOS X 上で alt キーは、option キーです。 文字には、大文字を使って下さい。 全てのプラットホームで、キーは自動的にメニュー項目表示に加えられます。
Note that the apple key on MacOS X is the meta key. The alt on MacOS X is the option key. For letters use uppercase. Keys are added to the menu item display automatically on all platforms.

§

gs:set-anti-aliasing

syntax: (gs:set-anti-aliasing boolean-flag)
parameter: boolean-flag - The anti aliasing setting for the current canvas true or nil.


(訳注:現在のカンバスへのアンチ・エリアシングを設定します。)
デフォルトの設定は、true です。
The default setting is true.

§

gs:set-background

syntax: (gs:set-background sym-id float-red float-green float-blue [float-alpha])
parameter: sym-id - The name of the component for which to set the color.
parameter: float-red - The red color component expressed as a number between 0.0 and 1.0.
parameter: float-green - The green color component expressed as a number between 0.0 and 1.0.
parameter: float-blue - The blue color component expressed as a number between 0.0 and 1.0.
parameter: float-alpha - The transparency of the color expressed as a number between 0.0 (fully transparent)and 1.0 (completely opaque).


syntax: (gs:set-background sym-id list-rgb [float-alpha])
parameter: sym-id - The name of the component for which to set the color.
parameter: list-rgb - The rgb color can be given as a list of three numbers.
parameter: float-alpha - The transparency of the color expressed as a number between 0.0 (fully transparent)and 1.0 (completely opaque).


(訳注:sym-id で指定されたコンポーネントの色を設定します。)
注記:set-background は、set-color と同じです。
Note set-background is the same as set-color.

§

gs:set-bevel-border

syntax: (gs:set-bevel-border sym-id str-type)
parameter: sym-id - The name of the component.
parameter: str-type - The type of the bevel "raised" or "lowered".


(訳注:sym-id で指定されたコンポーネントの境界の表示を "raised"(浮き出る)か "lowered"(沈む)に設定します。)


§

gs:set-border-layout

syntax: (gs:set-border-layout sym-container [int-hgap int-vgap])
parameter: sym-container - The name of the container for which border layout is set.
parameter: int-hgap - The horizontal gap between components in the border layout.
parameter: int-vgap - The vertical gap between components in the border layout.


(訳注:sym-container で指定されたコンテナをボーダー・レイアウトに設定します。)
ボーダー・レイアウトは、レイアウトを5つの領域、"north", "west", "center", "east", "south"、に分けます。 これらの文字定数は、ボーダー・レイアウトにコンポーネントを追加する時、 gs:add-to で使われます。
Border layout divides the layout into 5 zones labeled "north", "west", "center", "east" and "south". These string constants are used in the gs:add-to command when adding components to a border layout.

ボーダー・レイアウトでは、各コンポーネントは、サイズを指定されていなければ、最大サイズを取ろうとします。 コンポーネントがサイズ指定されているなら、特定の寸法が優先されます。 "north""south" コンポーネントは、最大幅に拡張され、高さは、コンポーネントのサイズ・パラメータで与えられます。 "east""west" コンポーネントは、先に、指定された幅を取り、可能なかぎり最大高さに拡張されます。 "center" コンポーネントは、残った最大スペースを取ります。
In a border layout each component will take the maximum size if components are not sized. If components are sized only some dimensions will be honored. The "north" and "south" components will stretch to maximum width and assume the height given in a size parameter of the component. The "east" and "west" components will stretch to the maximum height available assuming their width specified earlier. The "center" component will take the left over maximum space.

§

gs:set-canvas

syntax: (gs:set-canvas sym-id)
parameter: sym-id - The id of the canvas to switch to.


(訳注:sym-id のカンバスを現在のカンバスに設定します。)
sym-id のカンバスは、先に、gs:canvas 宣言文で生成されていなければなりません。 カンバスを引数として取らない全てのグラフィック操作は、自動的に現在のカンバスを参照します。 gs:set-canvas が使われていなければ、現在のカンバスは、最後に生成されたカンバスになります。
The canvas in sym-id must have been created earlier with a gs:canvas statement. All graphics operations which do not take a canvas as argument will automatically refer to this current canvas. If no gs:set-canvas is used, the current canvas is assumed to be the last one created.

§

gs:set-caret

syntax: (gs:set-caret sym-id int-offset)
parameter: sym-id - The name of the component for which to set the cursor caret.


(訳注:sym-id の(訳注:テキスト)コンポーネントのカーソル位置を設定します。)
この関数は、gs:select-text の dot と mark 位置(訳注:gs:select-text の int-from と int-to のこと)を同じオフセットで呼び出したのと同じ効果を持ちます。
The functions has the same effect as calling gs:select-text with the same offset for the dot and mark position.

§

gs:set-caret-color

syntax: (gs:set-caret-color sym-id float-red float-green float-blue)
parameter: sym-id - The name of the component for which to set the color.
parameter: float-red - The red color component expressed as a number between 0.0 and 1.0.
parameter: float-green - The green color component expressed as a number between 0.0 and 1.0.
parameter: float-blue - The blue color component expressed as a number between 0.0 and 1.0.
syntax: (gs:set-caret-color sym-id list-rgb [float-alpha])
parameter: sym-id - The name of the component for which to set the color.
parameter: list-rgb - The rgb color can be given as a list of three numbers.
(訳注:sym-id の(訳注:テキスト)コンポーネントのカーソルの色を設定します。)


§

gs:set-color

syntax: (gs:set-color sym-id float-red float-green float-blue [float-alpha])
parameter: sym-id - The name of the component for which to set the color.
parameter: float-red - The red color component expressed as a number between 0.0 and 1.0.
parameter: float-green - The green color component expressed as a number between 0.0 and 1.0.
parameter: float-blue - The blue color component expressed as a number between 0.0 and 1.0.
parameter: float-alpha - The transparency of the color expressed as a number between 0.0 (fully transparent)and 1.0 (completely opaque).


syntax: (gs:set-color sym-id list-rgb [float-alpha])
parameter: sym-id - The name of the component for which to set the color.
parameter: list-rgb - The rgb color can be given as a list of three numbers.
parameter: float-alpha - The transparency of the color expressed as a number between 0.0 (fully transparent)and 1.0 (completely opaque).


注記:set-color は、set-background と同じです。
Note that set-color is the same as set-background.

§

gs:set-cursor

syntax: (gs:set-cursor sym-id str-shape)
parameter: sym-id - The name of the frame, dialog or window.
parameter: str-shape - The string describing the cursor shape.


(訳注:sym-id のコンポーネントで表示されるマウス・カーソルの形状を設定します。)
カーソル形状は、次の中の一つが可能です:
The cursor shape can be one of the following:
  "default"
  "crosshair"
  "text"
  "wait"
  "sw-resize"
  "se-resize"
  "nw-resize"
  "ne-resize"
  "n-resize"
  "s-resize"
  "w-resize"
  "e-resize"
  "hand"
  "move"
 


§

gs:set-echo-char

syntax: (gs:set-echo-char sym-id [str-cover-char])
parameter: sym-id - The name of the component for which text is set.
parameter: str-cover-char - Cover character for password entry.
Example:
 (gs:set-echo-char 'TheTextField "*")
 (gs:set-echo-char 'TheTextField)   ; no echo, behave as normal text field
str-cover-text を指定しないか、str-cover-text の文字列長が 0 なら、 テキスト・フィールドは、通常のテキスト・フィールドになります(訳注: str-cover-text が設定されている時は、入力文字が str-cover-text で隠されます)。
If no str-cover-char is specyfied or the string in str-cover-char is of 0 length, then the text field behaves as a normal text field.

§

gs:set-editable

syntax: (gs:set-editable sym-id boolean-editable)
parameter: sym-id - The name of the text widget.
parameter: boolean-editable - The flag true or nil to indicate if this text widget can be edited.


(訳注:sym-id のテキスト・ウィジェットの編集許可(true)/禁止(nil)を設定します。)


§

gs:set-flow-layout

syntax: (gs:set-flow-layout sym-container [str-alignment [int-hgap int-vgap]])
parameter: sym-container - The name of the container for which flow layout is set.
parameter: sym-alignment - The alignment of the flow layout "left", "center" or "right".
parameter: int-hgap - The horizontal gap between components in the flow layout.
parameter: int-vgap - The vertical gap between components in the flow layout.


(訳注:sym-container で指定されたコンテナをフロアー・レイアウトに設定します。)
フロアー・レイアウトは、コンポーネントを自然にあるいは、希望サイズに表示します。 希望サイズは、関数gs:set-size を使って設定します。 ボタン・タイプ・ウィジェットやコンボ・ボックスは、含まれるテキストを示すのに必要なスペースを取ります。
The flow layout lets components appear in their natural or preferred size. The preferred size of a component is set using the function gs:set-size. Button-type widgets and combo boxes will take as much space as necessary to show the included text.

§

gs:set-font

syntax: (gs:set-font sym-id str-family int-size str-type)
parameter: sym-id - The name of the component for which to set the text font.
parameter: str-familiy - The family of the font, e.g.: "Monospaced", "Serif", "Sans Serif".
parameter: int-size - The font size in points.
parameter: str-type - The type of the font, one or more of "plain", "bold", "italic".


(訳注:sym-id のコンポーネントで使用されるテキスト・フォントを設定します。)
上記(訳注:フォント)ファミリー(訳注:"Monospaced", "Serif", "Sans Serif")以外は、プラットフォームに依存します。
More than the above noted families are available depending on the platform.

§

gs:set-foreground

syntax: (gs:set-foreground sym-id float-red float-green float-blue [float-alpha])
parameter: sym-id - The name of the component for which to set the color.
parameter: float-red - The red color component expressed as a number between 0.0 and 1.0.
parameter: float-green - The green color component expressed as a number between 0.0 and 1.0.
parameter: float-blue - The blue color component expressed as a number between 0.0 and 1.0.
parameter: float-alpha - The transparency of the color expressed as a number between 0.0 (fully transparent)and 1.0 (completely opaque).


syntax: (gs:set-foreground sym-id list-rgb [float-alpha])
parameter: sym-id - The name of the component for which to set the color.
parameter: list-rgb - The rgb color can be given as a list of three numbers.
parameter: float-alpha - The transparency of the color expressed as a number between 0.0 (fully transparent)and 1.0 (completely opaque).


(訳注:sym-id のコンポーネントで使用されるテキストの色を設定します。)
foreground color は、コンポーネントのテキストの色です。 The foreground color is the color of the text in a component.

§

gs:set-grid-layout

syntax: (gs:set-grid-layout sym-container int-rows int-columns [int-hgap int-vgap])
parameter: sym-container - The name of the container for which grid layout is set.
parameter: int-rows - The number of rows in the layout grid.
parameter: int-columns - The number of columns in the layout grid.
parameter: int-hgap - The horizontal gap between components in the grid layout.
parameter: int-vgap - The vertical gap between components in the grid layout.


(訳注:sym-container で指定されたコンテナをグリッド・レイアウトに設定します。)
グリッド・レイアウトでは、各コンポーネントは、gs:set-size で設定されたサイズに関わらず、 グリッド・セルで許される最大サイズを取ろうとします。 このおかげで、グリッド・レイアウトのセルは、gs:panel を使ったデフォルトでフロア・レイアウトを持つパネルで満たされ、gs:set-size を使ってのコンポーネントのサイズ決めの熟考を促します。 In a grid layout each component will assume the maximum size the grid cell allows regardless of sizes preset using gs:set-size Because of this grid layout cells are frequently filled with panels using gs:panel which have flow layout by default and allow deliberate sizing of components using gs:set-size.

§

gs:set-icon

syntax: (gs:set-icon sym-id str-icon-path [int-index])
parameter: sym-id - The name of a button or label or menu-item for which to set an icon.
parameter: str-icon-path - The file path of the icon to be set.
parameter: int-index - If sym-id is a tabbed pane int-index is the index of the tab.


(訳注:sym-id で指定されたボタンやラベルやメニュー・アイテムのアイコンを設定します。アイコンは、各コンポーネントに表示されるテキストの左側に配置されます。)


§

gs:set-look-and-feel

syntax: (gs:set-look-and-feel str-look)
parameter: str-look - The class description string for the look and feel of the application.


(訳注: GUI アプリケーションのルック・アンド・フィールを設定します。) 次の文字列が str-look で試せますが、プラットフォームによって、全て動作するとは限りません。 Mac では、デフォルトのルック・アンド・フィールは、デフォルトのスタイルとして JVM に組み込まれています。 "MacLookAndFeel" は、ここの明白な趣としては利用できないかもしれせんが、他のプラットフォームでは、使えるかもしれません。
The following strings can be tried in str-look, but not all will work on a specific platform. On the Mac the default look-and-feel is built-in to the JVM as the default style. The "MacLookAndFeel" is not available as an explicit flavor here, but may be on other platforms.
    "com.sun.java.swing.plaf.motif.MotifLookAndFeel"
"javax.swing.plaf.metal.MetalLookAndFeel"
"com.sun.java.swing.plaf.windows.WindowsLookAndFeel"
"javax.swing.plaf.mac.MacLookAndFeel"
"com.sun.java.swing.plaf.gtk.GTKLookAndFeel"


§

gs:set-paint

syntax: (gs:set-paint list-rgb)
parameter: list-rgb - The current paint used for outlines, text and fill color.


(訳注:2D Graphics function で使われる現在の色を設定します。)

§

gs:set-pressed-icon

syntax: (gs:set-pressed-icon sym-id str-icon-path)
parameter: sym-id - The name of the button, image button or toggle button.
parameter: str-icon-path - The file path of the icon or image to be set to the button in pressed state.


(訳注:sym-id で指定されたボタンが押された時に表示されるアイコンを設定します。)
イメージ・ボタンが押された時は、デフォルトで、小さいグレイのドットが表示されます。
By default a small grey dot is shown on image buttons when in a pressed state.

§

gs:set-resizable

syntax: (gs:set-resizable sym-frame boolean-resizable)
parameter: sym-frame - The name of the frame window.
parameter: bbolean-resizable - The flag true or nil to indicate if a frame can be resized by the user.
(訳注:フレーム・ウィンドウのリサイズの許可(true)/禁止(nil)を設定します。)


§

gs:set-rotation

syntax: (gs:set-rotation float-angle)
parameter: float-angle - The angle in degrees (0 - 360) of the canvas rotation.


(訳注:カンバスを回転します。角度が+なら時計回り、-なら反時計回りです。回転の中心は、カンバスの原点 (0,0) です。)
累積される gs:rotate-tag 操作と違って、gs:set-rotation は、呼ばれるごとに、その絶対値で回転します。
Unlike the gs:rotate-tag operation which is cumulative, gs:set-rotation will set an absolute rotation value each time it is called.

§

gs:set-scale

syntax: (gs:set-scale int-x int-y)
parameter: float-x - The X-scale value of the current canvas.
parameter: float-y - The Y-scale value of the current canvas.


(訳注:カンバスの原点を中心にカンバスを拡大・縮小します。)
累積される gs:scale-tag 操作と違って、gs:set-scale は、呼ばれるごとに、その絶対値で拡大・縮小します。
Unlike the gs:scale-tag operation which is cumulative, gs:set-scale will set an absolute scale value each time it is called.

§

gs:set-selected

syntax: (gs:set-selected sym-id boolean-selected [sym-id boolean-selected])
parameter: sym-id - The name of the toggle or radio button or check box or menu item.
parameter: boolean-selected - A flag of true or nil to indicated the selection state.


(訳注:sym-id で指定されたコンポーネント(トグル・ボタン、ラジオ・ボタン、チェック・ボックス等)の選択(あるいは、チェック)を設定します。)
(訳注:同時に)一個以上のトグル制御を選択または、非選択に設定できます。
More then one toggle control may be set selected or unselected.

§

gs:set-selection-color

syntax: (gs:set-selection-color sym-id float-red float-green float-blue [float-alpha])
parameter: sym-id - The name of the component for which to set the text selection color.
parameter: float-red - The red color component expressed as a number between 0.0 and 1.0.
parameter: float-green - The green color component expressed as a number between 0.0 and 1.0.
parameter: float-blue - The blue color component expressed as a number between 0.0 and 1.0.
parameter: float-alpha - The transparency of the color expressed as a number between 0.0 (fully transparent)and 1.0 (completely opaque).


syntax: (gs:set-selection-color sym-id list-rgb [float-alpha])
parameter: sym-id - The name of the component for which to set the text selection color.
parameter: list-rgb - The rgb color can be given as a list of three numbers.
parameter: float-alpha - The transparency of the color expressed as a number between 0.0 (fully transparent)and 1.0 (completely opaque).


(訳注:sym-id で指定されたコンポーネントで選択されたテキストの色を設定します。)
注記:set-background は、set-color と同じです。
Note set-background is the same as set-color.

§

gs:set-size

syntax: (gs:set-size sym-id int-width int-height)
parameter: sym-id - The name of the component of which a preferred size is set.
parameter: int-width - The preferred width of the component.
parameter: int-height - The preferred height of the component.


(訳注:sym-id で指定されたコンポーネントのサイズを設定します。)
全てのレイアウトでコンポーネントのサイズ設定が許されているわけでないことに注意して下さい。 グリッドやボーダー・レイアウトは、コンポーネントをレイアウトで可能な限り大きなサイズにします。
Note that not all layouts allow setting the size of a component. The grid and border layouts will size the component to its maximum possible in the layout.

§

gs:set-stroke

syntax: (gs:set-stroke float-width [str-cap [str-join [float-miterlimit]]])
parameter: float-width - The width for drawing lines and outlines in shapes.
parameter: str-cap - One of optional "butt" (default), "round" or "sqare".
parameter: str-join - One of optional "miter" (default), "bevel" or "round"


(訳注:カンバスに描画するラインや形状の外形ラインの太さを設定します。)
float-width 0f 0.0 では、可能な限り細いライン幅が選択されます。 Join は、二つのパスの交点と終点との交点に適用される装飾です。 Cap は、閉じていないパスやダッシュの終点に適用される装飾です。 float-miterlimit は、1.0 以上でなければなりません。
For a float-width 0f 0.0 the thinnest possible line width be chosen. Join is the decoration applied at the intersection of two path segments and at the intersection of the endpoints. Cap is the decoration applied to the ends of unclosed subpaths and dash segments. The float-miterlimit should be greater or equal 1.0.

§

gs:set-syntax

syntax: (gs:set-syntax sym-id str-type)
parameter: sym-id - The name of the text pane for syntax coloring is enabled or disabled.
parameter: str-type - A string "lsp", "c", "cpp", "java" or "php" to indicate the
syntax desired, or nil to switch off syntax highlighting.

(訳注:sym-id で指定された テキスト・パネ 表示される lisp や C ソースの構文に色を許可するかどうかを設定します。)
構文をハイライトする色は、白の背景色が予め選択されていますが、 gs:set-background, gs:set-foreground, gs:set-caret, gs:set-selection-color, gs:set-syntax-colors を使って変更可能です。
Colors for syntax highlighting are preselected for a white background, but can be changed using the following functions: gs:set-background, gs:set-foreground, gs:set-caret, gs:set-selection-color and gs:set-syntax-colors.

§

gs:set-syntax-colors

syntax: (gs:set-syntax-colors list-rgb-comment list-rgb-keyword list-rgb-string list-rgb-number list-rgb-quoted list-rgb-parentheses)
parameter: list-rgb-comment - The color for comments.
parameter: list-rgb-keyword - The color for reserved keywords.
parameter: list-rgb-string - The color for strings.
parameter: list-rgb-number - The color for numbers.
parameter: list-rgb-quoted - The color for the quote and quoted symbols.
parameter: list-rgb-parentheses - The color for parenthesis.


(訳注:構文をハイライトする色を設定します。)
構文をハイライトする色は、赤、緑、青の 0.0 ~ 1.0 間の値のリストで与えられます。 テキスト・パネに設定された構文色、テキスト色、背景色、次第で、カーソル色や選択されたテキストの色も変化します。 gs:text-pane を使って生成された テキスト・ウィジェットだけが、構文ハイライトできます。
Syntax highlighting colors are given as lists of red, green and blue values between 0.0 and 1.0. Depending on the syntax colors and the foreground and background colors set for the text pane, the caret color and color for selected text should also be changed. Only text widgets created using gs:text-pane feature syntax highlighting.

§

gs:set-tab-size

syntax: (gs:set-tab-size sym-id int-size)
parameter: sym-id - The name of the text area component.
parameter: int-size - The tabulator size.


(訳注:sym-id で指定されたテキスト・コンポーネントのタブの大きさを設定します。)
gs:set-tab-size は、固定されたスペースのフォントとしてのみ動作することに注意して下さい。
Note that gs:set-tab-size will only work with fixed spaced fonts.

§

gs:set-text

syntax: (gs:set-text sym-id str-text [int-index])
parameter: sym-id - The name of the component for which text is set.
parameter: str-text - The text to be set in the component.
parameter: int-index - The index for a tab if the sym-id is a tabbed pane.


(訳注:sym-id で指定されたコンポーネントにテキストを設定します。)


§

gs:set-titled-border

syntax: (gs:set-titled-border sym-component str-title)
parameter: sym-component - The name of the component.
parameter: str-title - The text in the titled border around the component.


(訳注:sym-id で指定されたコンポーネントの境界にタイトルを設定します。)
コンポーネントは、通常 panel です。
The component is usually a panel.

§

gs:set-tool-tip

syntax: (gs:set-tool-tip sym-id str-text)
parameter: sym-id - The name of the widget for which to supply a tool tip.
parameter: str-text - The text of the tool tip.


(訳注:sym-id で指定されたウィジェットに tool tip を供給します。)
tool tip テキストは、一定時間ウィジェットにマウスを重ねた後に表示されます。
The tool tip text is shown when leaving the mouse over the widget for certain amount of time.

§

gs:set-trace

syntax: (gs:set-trace boolean-flag)
parameter: boolean-flag - The flag true or nil.


§

gs:set-translation

syntax: (gs:set-translation int-x int-y)
parameter: int-x - The X-translation value of the current canvas.
parameter: int-y - The Y-translation value of the current canvas.


現在のカンバスの現在の原点を int-x int-y に移動します。 累積する gs:translate-tag 操作と違って、gs:set-translation は、呼ばれるごとに、その絶対値で移動します。
Translates the current origin of the current canvas to the point in int-x int-y. Unlike the gs:translate-tag operation which is cumulative, gs:set-translation will set an absolute translation value each time it is called.

§

gs:set-utf8

syntax: (gs:set-utf8 boolean-flag)
parameter: boolean - The flag true or nil to indicate if in UTF-8 mode.


UTF-8 モードに設定すると、guiserver は、ファイルのロード及びセーブ時にファイルを UTF-8 エンコードで変換します。 Mac OS X では、UTF-8 モードは、デフォルトで可能です。 開始時、guiserver.lsp は、newLISP が UTF-8 版かどうか検出し、それに応じて、gs:set-utf8 を使って、Guiserver のモードを切り替えます。
When set in UTF-8 mode, guiserver will convert files to UTF-8 encoding when loading and saving files. On Mac OS X UTF-8 mode is by default enabled. On startup guiserver.lsp will detect if newLISP is UTF-8 enabled and switch the mode in Guiserver accordingly using gs:set-utf8.

§

gs:set-value

syntax: (gs:set-value sym-id int-value)
parameter: sym-id - The name of a slider or progress bar for which to set the value.
parameter: int-value - The integer value of the name to be set.


(訳注:sym-id で指定されたスライダーやプログレス・バーの値を設定します。)
スライダーやプログレス・バーを生成した時に設定した最大値より大きく、または、最小値より小さく、値を設定すべきではありません。さもなければ、設定は、予め設定された最大値か最小値のどちらかになります。
The value should not be bigger or smaller than the minimum or maximum values set when creating the slider or progress bar, otherwise the setting will default to either the minimum or maximum preset value.

§

gs:set-visible

syntax: (gs:set-visible sym-id boolean-visible)
parameter: sym-id - The component which is hidden or made visible.
parameter: boolean-visible - A flag indicating if the component is visible "true", "nil".


(訳注:sym-id で指定されたコンポーネントを非表示/表示します。)
フレームとダイアログ・ウィンドウを除いて、コンポーネントは、デフォルトで可視化です。 通常、フレームとダイアログは、コンポーネントが内部に置かれるまで、可視化設定されません。
Except for frames and dialog windows, components are visible by default. Normally frames and dialogs are not set visible before all other components are placed inside.

§

gs:shear-tag

syntax: (gs:shear-tag sym-tag float-x float-y [boolean-repaint])
parameter: sym-tag - The tag group to shear.
parameter: float-x - The X shearing factor.
parameter: float-y - The Y shearing factor.
parameter: boolean-repaint - An optional flag to indicate if repainting is required (default is true).


(訳注:sym-tag で指定された 2Dグラフィックス・オブジェクトをハサミで潰すように変形します。)

§

gs:show-popup

syntax: (gs:show-popup sym-tag sym-host int-x int-y)
parameter: sym-tag - The id of the popup menu.
parameter: sym-host - The host container where to pop up the menu.
parameter: int-x - The X coordinate of the menu popup position.
parameter: int-y - The Y coordinate of the menu popup position.


(訳注:sym-tag で指定されたポップアップ・メニューを表示します。)

§

gs:show-tag

syntax: (gs:show-tag sym-tag [boolean-repaint])
parameter: sym-tag - The tag of the group to show.
parameter: boolean-repaint - An optional flag to indicate if repainting is required (default is true).


(訳注:sym-tag で指定された 2Dグラフィックス・オブジェクトを表示します。 オプションの boolean-repainttrue なら、再描画が要求されます。)

§

gs:slider

syntax: (gs:slider sym-id sym-action str-orientation int-min int-max int-initial-value)
parameter: sym-id - The name of the slider.
parameter: sym-action - The name of the event handler.
parameter: str-orientation - The orientation of the slider "horizontal" or "vertical"
parameter: int-min - The minimum value of the slider.
parameter: int-max - The maximum value of the slider.
parameter: int-initial-value - The initial value of the slider.


(訳注:sym-id で指定されたスライダーを生成します。
 イベント・ハンドラは、次のように記述します:
(define (slider-handler id value)
    (println id " " value)
)
selected は、int 型です。
 )

§

gs:split-pane

syntax: (gs:split-pane sym-id str-orientation [float-weight [float-location [int-divider-size]]])
parameter: sym-id - The name of the split-pane.
parameter: str-orientation - The orientation "horizontal" or "vertical".
parameter: float-weight - The optional weight distribution between 0.0 and 1.0 when re-sizing the window. The default is 0.0.
parameter: float-location - The optional initial divider location between 0.0 and 1.0.
parameter: int-divider-size - The optional size of the draggable divider in pixels.


(訳注:sym-id で指定されたスプリット・パネルを生成します。)

§

gs:stop-sequence

syntax: (gs:stop-sequence)


gs:play-sequence で開始したトラックの演奏を止めます。
Stops playing tracks, as started with gs:play-sequence.

§

gs:tabbed-pane

syntax: (gs:tabbed-pane sym-id sym-action str-orientation [sym-tab str-title ...])
parameter: sym-id - The name of the tabbed pane.
parameter: str-orientation - The position of the tabs; either "top" (default), "bottom","left" or "right".
parameter: sym-tab - The id symbol name of a tab
parameter: str-title - The title of the tab.


(訳注:sym-id で指定されたタブ付きパネルを生成します。
 イベント・ハンドラは、次のように記述します:
(define (tabs-action id cid tab idx)
    (println id " " cid " " (base64-dec tab) " " idx))

    id  - タブ付きパネルの ID  sym-id
    cid - タブの ID            sym-tab
    tab - base64 エンコードされたタブのタイトル文字列
    idx - 0 から始まるタブのインデックス
 )

§

gs:table

syntax: (gs:table sym-id sym-action [str-column-header-name ...])
parameter: sym-id - The name of the table.
parameter: sym-action - The handler function symbol when a cell is selected.
parameter: str-column-header-name - the optional column header name.


(訳注:sym-id で指定されたテーブルを生成します。)
str-column-header-name で指定された列が行無しで作成されます。 str-column-header-name に空文字列を指定した時は、見出しはからのままです。 列が一つも無いなら、空テーブル (0 x 0) が作られます。
Creates a table with str-column-header-name specified column and empty row. For empty strings specified as column headers, the header will be left empty. If all header in a table are specified as empty, the table will be created without a header row. If there are no columns at all, an empty table (0 x 0) is created.

セルが選択された時、sym-action の関数がテーブル ID、行番号、列番号、セルの内容と共に呼ばれます。 例は、table-demo.lsp ファイルで見て下さい。セルを選択するかダブル・クリックすれば、セル内容を編集できます。
When a cell is selected, the function in sym-action gets called with the table id, row, column and cell-contents. See the file table-demo.lsp for an example. Cells can be edited by either selecting or double clicking a cell.

(訳注:イベント・ハンドラは、次のように記述します:
(define (table-action id row column content)
    (println "id=" id " row=" row " col=" column " data=" content))

    id      - テーブルの ID
    row     - 0 から始まる行番号
    column  - 0 から始まる列番号
    content - base64 エンコードされていない文字列データ。(つまり、そのまま使えます)
 セルに移動すると発生します。
 セルの移動には、マウスの左クリック、矢印キー、return キー(下方、次の列の先頭、一列目の先頭)が使えます。
 セル内容の変更では、イベントは発生しません。  )

§

gs:table-add-column

syntax: (gs:table-add-column sym-id str-column-header-name ...)
parameter: sym-id - The name of the table.
parameter: str-column-header-name - Add column header name(s).


一個以上の列を str-column-header-name に指定して、追加できます。 列の見出しに空文字 "" を指定することもできます。 テーブルの見出しが全て空なら、見出し行は表示されません。
More than one str-column-header-name can be specified to add more than one column. A column header can be set empty using and empty string "". When all headers in a table are empty, the table will be displayed without a header row.

§

gs:table-add-row

syntax: (gs:table-add-row sym-id [str-columns ... ])
syntax: (gs:table-add-row sym-id ([str-columns ...))
parameter: sym-id - The name of the table.
parameter: str-columns - Add a row with contents in str-columns


各列を含む行を追加します。必要ならスクロールバーが現れます。 str-columns に内容が定義されないか、列の数より少ない定義の場合、列の内容は空になります。 複数列の内容は、文字列のリストか gs:table-add-row の追加パラメータでも指定できます。
Add row with each column value. If necessary a scrollbar will appear. If no contents is defined in str-columns, or if contents for less columns is defined than available, column contents is left empty. Mutliple column content can be specified as either a list of strings or addtional parameters of gs:table-add-row.

§

gs:table-get-cell

syntax: (gs:table-get-cell sym-id int-row int-column)
parameter: sym-id - The name of the table.
parameter: int-row - The row of the cell.
parameter: int-column - The column of the cell.

return: cell value. stored in gs:table-cell.



int-rowint-column で指定されたセルの内容を文字列として取り出します。 (訳注:変数gs:table-cell にも、保存されます。)
Get the cell contents as a string at sepcifed int-row and int-column.

§

gs:table-get-size

syntax: (gs:table-get-size sym-id)
parameter: sym-id - The name of the table.

return: table size list (row-size, column-size)



テーブル・サイズを取り出し、gs:table-size に保存します。 追加された列や行は、変数gs:table-size に自動的に更新されませんので、注意してください。 この変数 gs:table-size を更新するために、gs:table-get-size を使って下さい。
Get table size, stored in gs:table-size. Note, that adding columns or row will not automatically update the gs:table-size variable. Use gs:table-get-size to update this variable.

§

gs:table-remove-row

syntax: (gs:table-remove-row sym-id int-rownumber)
parameter: sym-id - The name of the table.
parameter: int-row - The row to remove


行を削除します。 gs:table-set-row-count も見てください。
Removes a row. See also gs:table-set-row-count.

§

gs:table-set-cell

syntax: (gs:table-set-cell sym-id int-row int-column str-value)
parameter: sym-id - The name of the table.
parameter: int-row - The row of the cell set.
parameter: int-column - The column of the cell set.
parameter: str-value - The cell value.

return: The previous contents of the cell; also stored in gs:table-cell.



テーブル・セルを新しい内容(訳注:str-value)に設定し、古いセル内容を返します。 行と列の番号は、'0' (zero) から始まります(テーブルに表示される番号は '1' から始まります)。 セルの内容は、文字列として渡されます(訳注:str-value は文字列入力です)。
Sets a new table cell contents and returns the old cell contents. Row and column numbering starts with '0' (zero). The cell contents is passed as a string.

§

gs:table-set-column

syntax: (gs:table-set-column sym-id int-column-number int-width [str-justification])
parameter: sym-id - The name of the table.
parameter: int-column-number - The column number of align.
parameter: int-width - The column width.
parameter: str-justification - The column align property, "left", "center", "right".


列幅の調整とセル内容の配置のテーブル列の属性を変更します。 str-justification パラメータはオプションで、デフォルトは "left" です。
A table column property is changed, adjusting the column width and alignment of cell contents. The str-justification parameter is optional and alignment is "left" by default.

§

gs:table-set-column-name

syntax: (gs:table-set-column-name sym-id [str-columns ... ])
syntax: (gs:table-set-column-name sym-id ([str-columns ...))
parameter: sym-id - The name of the table.
parameter: str-columns - Set column names with contents in str-columns


テーブルの列名を置き換えます。 名前の数が列数より多いなら、テーブルの各行の終わりに新たな列が追加されます。 列名が列数より少ないなら、余分な列が破棄されます。
Replaces the column names in the table. If the number of names is greater than the current number of columns, new columns are added to the end of each row in the table. If the number of columnnames is less than the current number of columns, all the extra columns at the end of a row are discarded.

§

gs:table-set-row-count

syntax: (gs:table-set-row-count sym-id int-row-count)
parameter: sym-id - The name of the table.
parameter: int-row - Set the numbers of rows in the table with int-row-count


テーブルの行数を設定します。 現行の大きさより大きいなら、新たな行がテーブルの終わりに追加されます。 現行の大きさより小さいなら、指定した行数より多い行が破棄されます。
Sets the number of rows in the table. If the new size is greater than the current size, new rows are added to the end of the table. If the new size is less than the current size, all rows at index rownumber and greater are discarded.

§

gs:table-get

syntax: (gs:table-get sym-id)

return: table cells. stored in gs:table-full.



全テーブルを行リストのリストとして取り出します。
Get full table as a list of row lists.
 ( ("column0" "column1" ... ) ; 1'st row
   ("column0" "column1" ... ) ; 2'nd row
   ...
   ... )
 


完全なテーブル内容が、gs:table-getの戻り値として、行リストのリストの収められ、 変数gs:table-full にも、保存されます。
The entire table contents is stored as a list of row lists in the return value of gs:table-get, and is also stored in the variable gs:table-full.

§

gs:table-set-row-number

syntax: (gs:table-set-row-number sym-id bool-row-number) DEPRECATED


gs:table-show-row-number を使ってください。 この古い名前はまだ使えますが、推奨されません。(訳注:実は、使えません。使えるようにするのは簡単ですが、gs:table-show-row-number を使いましょう!)
Use gs:table-show-row-number. The old naming is deprecated but will still work.

§

gs:table-show-row-number

syntax: (gs:table-show-row-number sym-id bool-row-number)
parameter: sym-id - The name of the table.
parameter: bool-row-number - true if rows should carry a row number; default nil.


行番号を表示/非表示します。デフォルトは、行番号の非表示です。
Show or hide the row number headers. The default is hiding row numbers.

§

gs:text-area

syntax: (gs:text-area sym-id sym-action int-width int-height)
parameter: symid - The name of the text area.
parameter: sym-action - The name of the event handler.
parameter: int-width - The optional width of the text area..
parameter: int-height - The optional height of the text area.


Example:
 (gs:text-area 'TheText 'textarea-event 10 8)

 (define (textarea-event id code dot mark) ...)
gs:text-area は、そのイベントに次のパラメータを伝えます:
gs:text-area transmits the following parameters in its event:
 id   - name of the widget 
 code - key code equals ASCII code. Only for text keys
 dot  - position of text caret in the text 
 mark - extended (selection) position of caret 
 


§

gs:text-field

syntax: (gs:text-field sym-id sym-action int-columns [str-cover-char])
parameter: sym-id - The name of the text field.
parameter: sym-action - The name of the event handler.
parameter: int-columns - The number of columns in the text field.
parameter: str-cover-char - Cover character for password entry.
Example:
 (gs:text-field 'TheTextField 'textfield-event)
 (gs:text-field 'PasswordTextField 'textfield-event "*")
テキスト・フィールドで enter キーが押された時、textfield-event が発生します。 もう一つの方のパスワード用のカバー文字は、gs:set-echo-char でも設定可能です。
The textfield-event is fired when the enter key is pressed in the text field. As an alternative the cover character for passwords can be set with gs:set-echo-char.
(訳注:イベント・ハンドラは、次のように記述します:
(define (textfield-event id text)
    (println id " " text)
)

 id   - テキスト・フィールドの ID
 text - base64エンコードされたテキスト
 )

§

gs:text-pane

syntax: (gs:text-pane sym-id sym-action str-style [int-width int-height])
parameter: sym-id - The name of the text pane.
parameter: sym-action - The key action handler for the html pane.
parameter: sym-style - The content type of the text pane.
parameter: int-width - The optional width of the pane.
parameter: int-height - The optional height of the pane.


gs:text-pane は gs:text-area のように使えます。 次のスタイルが sym-style でサポートされます:
The gs:text-pane is used similar to 'gs:text-area. The following styles are supported in sym-style:
    "text/plain"
    "text/html"
 


gs:text-pane ウィジェットは、テキストがパネの可視領域に合わない時、 自動的にスクロールバーを表示します。 括弧が入力されると、それらは、対応する開くもしくは閉じる括弧と、存在するなら、合致させます。 この振る舞いが望ましくないなら、代わりに、シンプルな gs:text-area を使うべきです。
The gs:text-pane widget will automatically display scroll bars when text does not fit in the visible space of the pane. When entering parentheses they are automatically matched with their opening or closing counterparts, if they exist. If this is undesired behavior, the simpler gs:text-area control should be used instead.

テキスト・パネでのカーソルの変化や(訳注:テキストの)選択で、 カーソル位置、選択位置、タイプされた最後の文字、キー修飾(訳注:shift キーなどの情報)を含んだ イベントを発生します。 このウィジェットで利用できる全ての機能を使った複雑なアプリケーションとして、 newlisp-edit.lsp ファイルを見て下さい。
On each change of the caret or selection in the text pane an event is fired containing several parameters about the caret and selection positions, the last character typed, and the modifier keys used. See the the file newlisp-edit.lsp for a complex application using all features available in this widget.

HTML 形式のテキストでハイパーリンクをクリック可能にするには、 関数 gs:set-editable を使って、編集不可にします。 gs:set-fontgs:append-text は、text/plain スタイルでのみ、動作します。
To make hyperlinks in HTML formatted text clickable, editing must be disabled using the gs:set-editable function. The functions gs:set-font and gs:append-text will work only on the text/plain content style.

Example:
 (gs:text-pane 'TheTextPane 'textpane-event "text/plain")

 (define (textpane-event id code mods dot mark len undo redo) ...)
gs:text-pane は、そのイベントに次のパラメータを伝えます:
gs:text-pane transmits the following parameters in its event:
 id   - name of the widget 
 code - key code equals ASCII code. Only for text keys 
 mods - keys pressed together with the previous, like shift, ctrl etc.
 dot  - position of the text caret in the text 
 mark - extended (selection) position of the caret 
 len  - length of the text in the textarea 
 undo - undo enabled/disabled 
 redo - redo enabled/disabled 
 


§

gs:toggle-button

syntax: (gs:toggle-button sym-id sym-action str-text [bool-selected])
parameter: sym-id - The name of the toggle button.
parameter: sym-action - The name of the event handler.
parameter: str-text - The optional text of the toggle button.
parameter: bool-selected - An optional flag true or nil (default) indicating the initial state of the toggle button.


(訳注:sym-id で指定されたトグル・ボタンを生成します。)

§

gs:tool-bar

syntax: (gs:tool-bar sym-frame [bool-floatable int-hgap int-vgap])
parameter: sym-frame - The name of the frame hosting the toolbar.
parameter: bool-floatable - The optional flag true or nil to indicate if the toolbar can be detached.
parameter: int-hgap - The horizontal gap between components on the toolbar.
parameter: int-vgap - The vertical gap between the components on the toolbar.


(訳注:sym-frame で指定されたフレームにツールバーを生成します。)

§

gs:translate-tag

syntax: (gs:translate-tag sym-tag int-x int-y [boolean-repaint])
parameter: sym-tag - The name tag of the group to translate.
parameter: int-x - The X-coordinate translation value.
parameter: int-y - The Y-coordinate translation value.
parameter: boolean-repaint - An optional flag to indicate if repainting is required (default is true).


sym-tag の全タグ・オブジェクトの座標系の原点を移動します。 全てのタグ操作のように複数の gs:translate-tag 操作は、累積されます。
Moves the origin of the coordinate system of all objects tagged with sym-tag. Like all tag operations multiple gs:translate-tag operations are cumulative.

§

gs:undo-text

syntax: (gs:undo-text sym-id)
parameter: sym-id - The id of the gs:text-pane where to perform an undo operation.


(訳注:sym-id で指定されたテキスト・パネでアンドゥします。)

§

gs:undo-enable

syntax: (gs:undo-enable sym-id boolean-enabled)
parameter: sym-id - The id of the gs:text-pane for which to enabe/disable undo.
parameter: boolean-enabled - true or nil to enable or disable undo.
(訳注:sym-id で指定されたテキスト・パネでのアンドゥの許可/禁止を設定します。)

§

gs:update

syntax: (gs:update)


現在のカンバスを再描画します、例えば、表示中のカンバスのスケールを変更したり、移動したりした後に。 多くのスクリーンの更新は自動的に行われるので、この関数は、めったに使われません。 多くのタグ操作は、その描画の後、更新を促すパラメータを付加できます。
Forces a repaint of the current canvas, e.g. after changing the scale or translation of a visible canvas. This function is rarely used, as most screen updates are performed automatically. All tag operations can carry an additional parameter to force update after they have been draw.

§

gs:window

syntax: (gs:window sym-id int-x int-y int-width int-height)
parameter: sym-id - The name of the invisible window.
parameter: int-x - The x-coordinate of the screen position.
parameter: int-y - The y-coordinate of the screen position.
parameter: int-width - The width of the window.
parameter: int-height - The height of the window.


境界のないウィンドウを生成します。ボーダーレス・ウィンドウは、いくつかの搭載されたコンポーネントに通常のフレームやダイアログとは異なる扱いをします。
Creates a borderless window. Note that a borderless window may treat some hosted components differently from normal frames and dialogs. (訳注:ボーダーレス・ウィンドウは、移動やサイズ変更ができません。)

§

gs:window-closed

syntax: (gs:window-closed sym-id sym-action)
parameter: sym-id - The name of the frame or dialog.
parameter: sym-action - The action to perform when the frame or dialog closes.


ウィンドウやダイアログは、ウィンドウの角にあるシステム・クローズ・ボタンを使って、閉じることができます。 この場合、閉じる際に呼ばれるハンドラ関数を指定するのに利用できます。
A window or dialog window can be closed using the system close button in one of the corners of the window. In this case it is useful to specify a handler function which is called upon closing.

§

gs:window-moved

syntax: (gs:window-moved sym-id sym-action)
parameter: sym-id - The name of the frame or dialog.
parameter: sym-action - The action to perform when the frame or dialog moves.


sym-id で指定されたウィンドウやダイアログが移動した時に発生するイベントsym-actionを設定します。)
イベントは、ウィンドウやダイアログの sym-id とスクリーン上の現在の XY 座標を運びます。
The event will carry the sym-id of the window or dialog and current X and Y coordinates on the screen.
(訳注:イベント・ハンドラは、次のように記述します:
(define (moved-action id X Y)
  (println id " " X " " Y)
)
 )



§

gs:window-resized

syntax: (gs:window-resized sym-id sym-action)
parameter: sym-id - The name of the frame or dialog.
parameter: sym-action - The action to perform when the frame or dialog is resized.


sym-id で指定されたウィンドウやダイアログが移動した時に発生するイベントsym-actionを設定します。)
イベントは、ウィンドウやダイアログの sym-id とスクリーン上の現在の幅と高さを運びます。
The event will carry the sym-id of the window or dialog and current width and height.
(訳注:イベント・ハンドラは、次のように記述します:
(define (resize-action id width height)
  (println id " " width " " height)
)
 )

- ∂ -

generated with newLISP  and newLISPdoc