// ボタンが押された際に呼ばれるイベントハンドラ関数 void onButtonClick(int id, string label) { string text = getComponentText(textField); // テキストフィールドのテキストを取得 alert(text); // ダイアログで表示 }