In Files

  • tk/lib/tcltk.rb



Class/Module Index [+]



class TclTkVariable: tcl/tk variable

Public Class Methods

new(interp, dat) click to toggle source

initialize(interp, dat):

interp: interpreter(TclTkInterpreter)
dat: the value to set(String)
    if nil, not initialize variable
               # File tk/lib/tcltk.rb, line 230
def initialize(interp, dat)
  # auto-generate tcl/tk representation (variable name)
  exp = TclTk._newname("v_")
  # initialize TclTkObject
  super(interp._tcltkip(), exp)
  # safe this for `set' command
  @set = interp.commands()["set"]
  # set value
  set(dat) if dat

Public Instance Methods

get() click to toggle source

get(): read tcl/tk variable(String) using `set’

               # File tk/lib/tcltk.rb, line 251
def get()
  return @set.e(to_s())
set(data) click to toggle source

set(data): set tcl/tk variable using `set’

data: new value
               # File tk/lib/tcltk.rb, line 246
def set(data)
  @set.e(to_s(), data.to_s())

Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.

If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.

If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.

If you want to help improve the Ruby documentation, please visit