1 #
2 # tk/mngfocus.rb : methods for Tcl/Tk standard library 'focus.tcl'
3 # by Hidetoshi Nagai <nagai@ai.kyutech.ac.jp>
4 #
5 require 'tk'
6
7 module TkManageFocus
8 extend Tk
9
10 TkCommandNames = [
11 'tk_focusFollowMouse'.freeze,
12 'tk_focusNext'.freeze,
13 'tk_focusPrev'.freeze
14 ].freeze
15
16 def TkManageFocus.followsMouse
17 tk_call_without_enc('tk_focusFollowsMouse')
18 end
19
20 def TkManageFocus.next(win)
21 tk_tcl2ruby(tk_call('tk_focusNext', win))
22 end
23 def focusNext
24 TkManageFocus.next(self)
25 end
26
27 def TkManageFocus.prev(win)
28 tk_tcl2ruby(tk_call('tk_focusPrev', win))
29 end
30 def focusPrev
31 TkManageFocus.prev(self)
32 end
33 end