I have a problem, regarding setMethod for "tkpack" and "tkgrid".

Please see attached file.

I am using a Linux-gnu platform and the 1.7.0 version of R.


        Lars Hougaard Hansen
## problem regarding "setMethod" for "tkpack" and "tkgrid".

library(methods)
library(tcltk)

# a class, "select", is defined, by

setClass("select",representation(listbox="tkwin", listvariable="tclVar"))

# Defining the method "tclvalue" for an object of class "select", by

setMethod("tclvalue","select",
          function(x)
          tclvalue(x@listvariable)
          )

# is accepted as legal R-code. But, when trying to do the same for "tkpack"
# and "tkgrid", R prints an Error.

setMethod("tkpack","select",
          function(x,...)
          tkpack(x@listbox,...)
          )

setMethod("tkgrid","select",
          function(x,...)
          tkgrid(x@listbox,...)
          )

# Error message:
#
# Error in makeGeneric(name, fdef, fdeflt, group = group, valueClass = valueClass,  : 
#        No suitable arguments to dispatch methods in this function

Reply via email to