summaryrefslogtreecommitdiff
path: root/trunk/ext/curses/mouse.rb
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-25 15:13:14 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-25 15:13:14 +0000
commitd0233291bc8a5068e52c69c210e5979e5324b5bc (patch)
tree7d9459449c33792c63eeb7baa071e76352e0baab /trunk/ext/curses/mouse.rb
parent0dc342de848a642ecce8db697b8fecd83a63e117 (diff)
parent72eaacaa15256ab95c3b52ea386f88586fb9da40 (diff)
re-adding tag v1_9_0_4 as an alias of trunk@18848v1_9_0_4
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_9_0_4@18849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'trunk/ext/curses/mouse.rb')
-rw-r--r--trunk/ext/curses/mouse.rb53
1 files changed, 0 insertions, 53 deletions
diff --git a/trunk/ext/curses/mouse.rb b/trunk/ext/curses/mouse.rb
deleted file mode 100644
index c42bc31f33..0000000000
--- a/trunk/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