class_docstr: Manage GObject lifetime.
  
      
docstr: Make a new GObject pointer from a gtype.
  
  This is useful for subclasses which need to control the construction
  process.
  
  You can pass the result pointer to the Python constructor for the
  object you are building. You will need to call VipsObject.build() to
  finish construction.
  
  Returns:
      A pointer to a new GObject.
  
  Raises:
      :class:`.Error`
docstr_tok: ["Make","a","new","GObject","pointer","from","a","gtype",".","This","is","useful","for","subclasses","which","need","to","control","the","construction","process",".","You","can","pass","the","result","pointer","to","the","Python","constructor","for","the","object","you","are","building",".","You","will","need","to","call","VipsObject.build","(",")","to","finish","construction",".","Returns",":","A","pointer","to","a","new","GObject",".","Raises",":",":","class",":","`",".Error","`"]
code: def new_pointer_from_gtype(gtype):
      """Make a new GObject pointer from a gtype.
  
      This is useful for subclasses which need to control the construction
      process.
  
      You can pass the result pointer to the Python constructor for the
      object you are building. You will need to call VipsObject.build() to
      finish construction.
  
      Returns:
          A pointer to a new GObject.
  
      Raises:
          :class:`.Error`
  
      """
  
      pointer = gobject_lib.g_object_new(gtype, ffi.NULL)
      if pointer == ffi.NULL:
          raise Error("can't create {0}".format(type_name(gtype)))
  
      return pointer
  
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 2 for calling the GObject obj's underlying member method code with example usage: obj.new_pointer_from_gtype(gtype) and returns: pointer