From: Masaki Suketa Date: 1997-08-29T12:54:15+09:00 Subject: [ruby-list:3925] Re: document for beginner 助田です >きくたにです。 >cursesなんかは使いかたがわからないんですけど。 私も使い方わからなかったんで、curses.c ファイルと C の curses libraryの説明が載ってた本を元に、試行錯誤しました。 大したことしてないんですけど curses 使う参考になればと思い以下に ソース付けます。 以前の curses 拡張モジュールに付いていたサンプルコードを元に私が 修正したコードです。(そのままだと動作しませんでした。うまく動作 しない部分は削除したりしてます。) include Curses def show_message(message) width = message.length + 10 win = Window.new(7, width, (20 - 5) / 2, (50 - width) / 2) win.box(?|, ?=) win.setpos(2, 3) win.addstr(message) win.setpos(4, 3) win.addstr("Please input some key to exit") win.refresh win.getch end init_screen begin show_message("Welcome to ruby's world !!!") ensure close_screen end 助田 雅紀(suke@tonen.co.jp)