# File lib/fox16/signal.rb, line 41
    def addSignal(sig, *args, &block)
      params = {}
      params = args.pop if args.last.is_a? Hash
      tgt, sel, immediate, flags = nil, 0, false, 0
      if args.length > 0
        if args[0].respond_to? :call
          tgt = FXPseudoTarget.new
          tgt.pconnect(SEL_SIGNAL, args[0], params)
          immediate = (args.length > 1) ? args[1] : false
          flags = (args.length > 2) ? args[2] : 0
        elsif (args[0].kind_of? TrueClass) || (args[0].kind_of? FalseClass)
          tgt = FXPseudoTarget.new
          tgt.pconnect(SEL_SIGNAL, block, params)
          immediate = args[0]
          flags = (args.length > 1) ? args[1] : 0
        else # it's some other kind of object
          tgt = args[0]
          sel = (args.length > 1) ? args[1] : 0
          immediate = (args.length > 2) ? args[2] : false
          flags = (args.length > 3) ? args[3] : 0
        end
      else
        tgt = FXPseudoTarget.new
        tgt.pconnect(SEL_SIGNAL, block, params)
      end
      addSignalOrig(sig, tgt, sel, immediate, flags)
    end