### Name: addCBFunction
### Title: Add a potential callback function for an event
### Aliases: addCBFunction
### Keywords: data

### ** Examples

  if (interactive())
  {
    loadData("USArrests")
    setActiveMVC("USArrests")
    getDescForEvent("leftButtonClick")

    changePch<-function(rowName)
    {
      curMVC<-getMVCFromWinNum()
      virtualData<-virtualData(model(curMVC))

      # column name
      colName<-"pch"

      # need to change the virtualData slot in model object 
      # using messages
      # for this example, just set the pch value to 2
      colIndex<-match(colName, colnames(virtualData))
      rowIndex<-match(rowName, rownames(virtualData))
      # determining the pch value should be set in a preprocessing function
      newPchValue<-2

      mData<-as.list(newPchValue)
      names(mData)<-rowName

      # if a point was clicked, then we want to create a 
      # gUpdateDataMessage
      dfMessage<-new("gUpdateDataMessage", type=colName, mData=mData,
                 dataName=modelName(model(curMVC)), from="")
      handleMessage(dfMessage)
    }

    addCBFunction(changePch, "change the plotting character", NULL,
    c("leftButtonClick", "middleButtonClick", "rightButtonClick"))

    getDescForEvent("leftButtonClick")
  }



