class_docstr: Manage GObject lifetime.
  
      
docstr: Connect to a signal on this object.
  
  The callback will be triggered every time this signal is issued on this
  instance. It will be passed the image ('self' here), and a single
  `void *` pointer from libvips.
  
  The value of the pointer, if any, depends on the signal -- for
  example, ::eval passes a pointer to a `VipsProgress` struct.
docstr_tok: ["Connect","to","a","signal","on","this","object",".","The","callback","will","be","triggered","every","time","this","signal","is","issued","on","this","instance",".","It","will","be","passed","the","image","(","'self","'","here",")",",","and","a","single","`","void","*","`","pointer","from","libvips",".","The","value","of","the","pointer",",","if","any",",","depends","on","the","signal","--","for","example",",",":",":eval","passes","a","pointer","to","a","`","VipsProgress","`","struct","."]
code: def signal_connect(self, name, callback):
      """Connect to a signal on this object.
  
      The callback will be triggered every time this signal is issued on this
      instance. It will be passed the image ('self' here), and a single
      `void *` pointer from libvips.
  
      The value of the pointer, if any, depends on the signal -- for
      example, ::eval passes a pointer to a `VipsProgress` struct.
  
      """
  
      if name not in _marshalers:
          raise Error('unsupported signal "{0}"'.format(name))
  
      go = ffi.cast("GObject *", self.pointer)
      handle = ffi.new_handle(callback)
      # we need to keep refs to the ffi handle and the callback to prevent
      # them being GCed
      # the callback might be a bound method (a closure) rather than a simple
      # function, so it can vanish
      self._handles.append(handle)
      self._handles.append(callback)
  
      gobject_lib.g_signal_connect_data(
          go, _to_bytes(name), _marshalers[name], handle, ffi.NULL, 0
      )
  
file_path: pyvips/pyvips/gobject.py
imports: from __future__ import division
  import logging
  import pyvips
  from pyvips import ffi, gobject_lib, _to_bytes, Error, type_name, at_least_libvips
label_desc: Use image node_id 3 for calling the GObject obj's underlying member method code with example usage: obj.signal_connect(name, callback) without return types