mirror of
https://github.com/ruby/ruby.git
synced 2025-08-26 06:25:31 +02:00

the running script is '-e one-liner' or '-' (stdin). * ext/tcltklib/extconf.rb: add find_library("#{lib}#{ver}",..) for stub libs * ext/tk/lib/tk/textmark.rb: TkTextMarkCurrent and TkTextMarkAnchor have a wrong parent class. * ext/tk/lib/tk/dialog.rb: rename TkDialog2 --> TkDialogObj and TkWarning2 --> TkWarningObj (old names are changed to alias names) * ext/tk/lib/tk/dialog.rb: bug fix of treatment of 'prev_command' option and hashes for configuration * ext/tk/lib/tk/dialog.rb: add TkDialogObj#name to return the button name * ext/tk/lib/tk/radiobutton.rb: rename enbugged method value() ==> get_value() and value=(val) ==> set_value(val). * ext/tk/lib/tk/menu.rb: add TkMenu.new_menuspec * ext/tk/lib/tk/menu.rb: add alias (TkMenuButton = TkMenubutton, TkOptionMenuButton = TkOptionMenubutton) * ext/tk/lib/tk/event.rb: new method aliases (same as option keys of event_generate) for Event object * ext/tk/lib/tk/font.rb: configinfo returns proper types of values * ext/tk/lib/tk.rb: bind methods accept subst_args + block * ext/tk/lib/tk/canvas.rb: ditto * ext/tk/lib/tk/canvastag.rb: ditto * ext/tk/lib/tk/frame.rb: ditto * ext/tk/lib/tk/text.rb: ditto * ext/tk/lib/tk/texttag.rb: ditto * ext/tk/lib/tk/toplevel.rb: ditto * ext/tk/lib/tkextlib/*: ditto and bug fix git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7512 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
76 lines
1.6 KiB
Ruby
76 lines
1.6 KiB
Ruby
#
|
|
# tkextlib/bwidget/entry.rb
|
|
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
|
|
#
|
|
|
|
require 'tk'
|
|
require 'tkextlib/bwidget.rb'
|
|
require 'tkextlib/bwidget/arrowbutton'
|
|
require 'tkextlib/bwidget/entry'
|
|
|
|
module Tk
|
|
module BWidget
|
|
class SpinBox < TkEntry
|
|
end
|
|
end
|
|
end
|
|
|
|
class Tk::BWidget::SpinBox
|
|
include Scrollable
|
|
|
|
TkCommandNames = ['SpinBox'.freeze].freeze
|
|
WidgetClassName = 'SpinBox'.freeze
|
|
WidgetClassNames[WidgetClassName] = self
|
|
|
|
#def entrybind(*args)
|
|
# _bind([path, 'bind'], *args)
|
|
# self
|
|
#end
|
|
def entrybind(context, *args)
|
|
if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
|
|
cmd = args.shift
|
|
else
|
|
cmd = Proc.new
|
|
end
|
|
_bind([path, 'bind'], context, cmd, *args)
|
|
self
|
|
end
|
|
|
|
#def entrybind_append(*args)
|
|
# _bind_append([path, 'bind'], *args)
|
|
# self
|
|
#end
|
|
def entrybind_append(context, *args)
|
|
if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
|
|
cmd = args.shift
|
|
else
|
|
cmd = Proc.new
|
|
end
|
|
_bind_append([path, 'bind'], context, cmd, *args)
|
|
self
|
|
end
|
|
|
|
def entrybind_remove(*args)
|
|
_bind_remove([path, 'bind'], *args)
|
|
self
|
|
end
|
|
|
|
def entrybindinfo(*args)
|
|
_bindinfo([path, 'bind'], *args)
|
|
self
|
|
end
|
|
|
|
def get_index_of_value
|
|
number(tk_send_without_enc('getvalue'))
|
|
end
|
|
alias get_value get_index_of_value
|
|
alias get_value_index get_index_of_value
|
|
|
|
def set_value_by_index(idx)
|
|
idx = "@#{idx}" if idx.kind_of?(Integer)
|
|
tk_send_without_enc('setvalue', idx)
|
|
self
|
|
end
|
|
alias set_value set_value_by_index
|
|
alias set_index_value set_value_by_index
|
|
end
|