| Class | TclTkWidget |
| In: |
tk/lib/tcltk.rb
|
| Parent: | TclTkCommand |
class TclTkWidget: tcl/tk widget
initialize(*args):
*args: parameters
# File tk/lib/tcltk.rb, line 260 def initialize(*args) if args[0].kind_of?(TclTkIp) # in case the 1st argument is TclTkIp: # Wrap tcl/tk widget by TclTkWidget # (used in TclTkInterpreter#initialize()) # need two arguments fail("illegal # of parameter") if args.size != 2 # ip: interpreter(TclTkIp) # exp: tcl/tk representation ip, exp = args # initialize TclTkObject super(ip, exp) elsif args[0].kind_of?(TclTkInterpreter) # in case 1st parameter is TclTkInterpreter: # generate new widget from parent widget # interp: interpreter(TclTkInterpreter) # parent: parent widget # command: widget generating tk command(label Εω) # *args: argument to the command interp, parent, command, *args = args # generate widget name exp = parent.to_s() exp += "." if exp !~ /[.]$/ exp += TclTk._newname("w_") # initialize TclTkObject super(interp._tcltkip(), exp) # generate widget res = @ip._eval_args(command, exp, *args) # fail("can't create Widget") if res != exp # for tk_optionMenu, it is legal res != exp else fail("first parameter is not TclTkInterpreter") end end
ruby-doc.org is a service of James Britt and Happy Camper Studios, a Ruby application development company in Phoenix, AZ.
Documentation content on ruby-doc.org is provided by remarkable members of the Ruby community.
For more information on the Ruby programming language, visit ruby-lang.org.
Want to help improve Ruby's API docs? See Ruby Documentation Guidelines.