def on_attach(obj=nil, &block)
      @on_attach_obj = obj
      @on_attach = Proc.new { |handle, obj_ptr|
	    yield handle, object_for(obj_ptr)
      }
      Klass.set_OnAttach_Handler(@handle, @on_attach, pointer_for(obj))
    end
def on_attach(obj=nil, &block)
      @on_attach_obj = obj
      @on_attach = Proc.new { |handle, obj_ptr|
	    yield handle, object_for(obj_ptr)
      }
      Klass.set_OnAttach_Handler(@handle, @on_attach, pointer_for(obj))
    end
Sets an attach handler callback function. This is called when a Phidget is plugged into the system.

 @param [String] obj Object to pass to the callback function. This is optional.
 @param [Proc] Block When the callback is executed, the device and object are yielded to this block.
 @example
     manager.on_attach do |device_ptr, obj|
       puts "Attaching #{Phidgets::Common.name(device_ptr)}"
     end
 As this runs in it's own thread, be sure that all errors are properly handled or the thread will halt and not fire any more.
 @return [Boolean] returns true or raises an error