import GUI; // ウィンドウ、テキストフィールド、ボタンを生成 int window = newWindow(0, 0, 350, 180, "WINDOW"); int textField = newTextField(10, 10, 300, 20, "TEXTFIELD"); int button = newButton(10, 50, 300, 50, "BUTTON"); // テキストフィールドとボタンを、ウィンドウ上に配置 mountComponent(textField, window); mountComponent(button, window); // ボタンが押された際に呼ばれるイベントハンドラ関数 void onButtonClick(int id, string label) { string text = getComponentText(textField); // テキストフィールドのテキストを取得 alert(text); // ダイアログで表示 }