1999-08-13 01:37:52 -04:00
|
|
|
#
|
|
|
|
# tkmngfocus.rb : methods for Tcl/Tk standard library 'focus.tcl'
|
2003-06-18 15:46:20 -04:00
|
|
|
# by Hidetoshi Nagai <nagai@ai.kyutech.ac.jp>
|
1999-08-13 01:37:52 -04:00
|
|
|
#
|
|
|
|
require 'tk'
|
|
|
|
|
|
|
|
module TkManageFocus
|
|
|
|
extend Tk
|
|
|
|
|
2003-07-23 12:07:35 -04:00
|
|
|
TkCommandNames = [
|
|
|
|
'tk_focusFollowMouse'.freeze,
|
|
|
|
'tk_focusNext'.freeze,
|
|
|
|
'tk_focusPrev'.freeze
|
|
|
|
].freeze
|
|
|
|
|
1999-08-13 01:37:52 -04:00
|
|
|
def TkManageFocus.followsMouse
|
|
|
|
tk_call 'tk_focusFollowsMouse'
|
|
|
|
end
|
|
|
|
|
|
|
|
def TkManageFocus.next(window)
|
2003-06-18 15:46:20 -04:00
|
|
|
tk_tcl2ruby(tk_call('tk_focusNext', window))
|
1999-08-13 01:37:52 -04:00
|
|
|
end
|
|
|
|
def focusNext
|
|
|
|
TkManageFocus.next(self)
|
|
|
|
end
|
|
|
|
|
|
|
|
def TkManageFocus.prev(window)
|
2003-06-18 15:46:20 -04:00
|
|
|
tk_tcl2ruby(tk_call('tk_focusPrev', window))
|
1999-08-13 01:37:52 -04:00
|
|
|
end
|
|
|
|
def focusPrev
|
|
|
|
TkManageFocus.prev(self)
|
|
|
|
end
|
|
|
|
end
|