def on_detach(obj=nil, &block)
      @on_detach_obj = obj
      @on_detach = Proc.new { |handle, obj_ptr|
        yield handle, object_for(obj_ptr)
      }
      Klass.set_OnDetach_Handler(@handle, @on_detach, pointer_for(obj))
    end
def on_detach(obj=nil, &block)
      @on_detach_obj = obj
      @on_detach = Proc.new { |handle, obj_ptr|
        yield handle, object_for(obj_ptr)
      }
      Klass.set_OnDetach_Handler(@handle, @on_detach, pointer_for(obj))
    end
def on_detach ( obj = nil , & block ) @on_detach_obj = obj @on_detach = Proc . new { | handle , obj_ptr | yield handle , object_for ( obj_ptr ) } Klass . set_OnDetach_Handler ( @handle , @on_detach , pointer_for ( obj ) ) end
Sets a detach handler callback function. This is called when a Phidget is unplugged from 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_detach do |device_ptr, obj|
       puts "Detaching #{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
Sets a detach handler callback function . This is called when a Phidget is unplugged from the system .