diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-05-14 11:39:21 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-05-14 11:39:21 +0000 |
commit | e76eb06feb024828034379797129d92522e28516 (patch) | |
tree | 1326c625c233ba2554043203a7697f5e3d4c49e5 /ruby_1_9_3/ext/curses/mouse.rb | |
parent | aa6e98139c8e1ea442fb2182341aaa08ff55b529 (diff) | |
parent | bede15ac5e701ed08f3fc64c2dba03d3f393c652 (diff) |
add tag v1_9_3_426v1_9_3_426
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_9_3_426@40737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby_1_9_3/ext/curses/mouse.rb')
-rw-r--r-- | ruby_1_9_3/ext/curses/mouse.rb | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/ruby_1_9_3/ext/curses/mouse.rb b/ruby_1_9_3/ext/curses/mouse.rb deleted file mode 100644 index c42bc31f33..0000000000 --- a/ruby_1_9_3/ext/curses/mouse.rb +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/local/bin/ruby - -require "curses" -include Curses - -def show_message(*msgs) - message = msgs.join - width = message.length + 6 - win = Window.new(5, width, - (lines - 5) / 2, (cols - width) / 2) - win.keypad = true - win.attron(color_pair(COLOR_RED)){ - win.box(?|, ?-, ?+) - } - win.setpos(2, 3) - win.addstr(message) - win.refresh - win.getch - win.close -end - -init_screen -start_color -init_pair(COLOR_BLUE,COLOR_BLUE,COLOR_WHITE) -init_pair(COLOR_RED,COLOR_RED,COLOR_WHITE) -crmode -noecho -stdscr.keypad(true) - -begin - mousemask(BUTTON1_CLICKED|BUTTON2_CLICKED|BUTTON3_CLICKED|BUTTON4_CLICKED) - setpos((lines - 5) / 2, (cols - 10) / 2) - attron(color_pair(COLOR_BLUE)|A_BOLD){ - addstr("click") - } - refresh - while( true ) - c = getch - case c - when KEY_MOUSE - m = getmouse - if( m ) - show_message("getch = #{c.inspect}, ", - "mouse event = #{'0x%x' % m.bstate}, ", - "axis = (#{m.x},#{m.y},#{m.z})") - end - break - end - end - refresh -ensure - close_screen -end |