How to modify the Gdk.gc of a GDraw.pixmap ?

Robert Roessler robertr at
Fri Oct 13 00:59:52 CEST 2006

Stalkern 2 wrote:
> I'm in trouble when trying to draw dotted lines and the like.
> I have a GDraw.pixmap and I would like to use the function
> 	Gdk.GC.set_dashes : Gdk.gc -> offset:int -> int list -> unit
> on it.
> But how do I access the Gdk.gc of a GDraw.pixmap _directly_?
> Shall I create a new GC and then... ?
> I feel like there is something that in spite of my copy of ocamlbrowser,
> I can't browse very clearly yet ;-))
> Thx for _any_ hint!

I would say to do a GC.create call supplying the drawable (pixmap in 
this case) that you want to work with.

Also, if it helps, a pixmap does not "have" a gc in the sense of 
owning one - you create a gc with an exemplar pixmap for the purpose 
of [for example] drawing into that pixmap - or others like it.

Finally, note that set_dashes is just setting an attribute (a "value" 
in Gdk-land)... you will need to supply that gc along with a 
compatible drawable to a "draw" function to actually get your dotted 

Robert Roessler
robertr at

More information about the Lablgtk-list mailing list