Chisheng Huang | 10 Jul 2008 21:05

How to make an instance of gdk:gc?

Hi,

The C function, gdk_gc_new, takes a GdkDrawable argument to make a 
graphics context.   The class definition of GDK:GC generated in 
(define-types-by-introspection "Gdk" ...) is:

  (DEFCLASS GC (GOBJECT)
    ()
    (:METACLASS GOBJECT-CLASS)
    (:GTYPE |gdk_gc_get_type|))

How can I supply a gdk:drawable instance when making a GDK:GC with
(MAKE-INSTANCE 'GDK:GC ...)?

I've been using the following binding for a while

(defbinding gc-new () gc
  (drawable drawable))

and I've seen the following error a few times:

  #<TYPE-ERROR {D912E79}>
  is a TYPE-ERROR.
  Its slot values are
  (:DATUM #<GTK:TREE-VIEW-COLUMN at 0x132F230> :EXPECTED-TYPE GDK:GC).

  0: ((LAMBDA (CAUSE)) The value #<GTK:TREE-VIEW-COLUMN at 0x132F230> is not 
     of type GDK:GC.)

It looks like a GDK:GC instance created by GC-NEW was pointing to a 
wrong object after it was used for some time.  This prompts me to find
a way to make a GDK:GC instance through the proper MAKE-INSTANCE machinery.
Any help on this will be greatly appreciated.

Best wishes,

-cph

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08

Gmane