From: Olivier Andrieu MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Message-ID: <17711.20033.771583.108905 at karryall.dnsalias.org> Date: Fri, 13 Oct 2006 10:28:49 +0200 To: Stalkern 2 Cc: lablgtk at math.nagoya-u.ac.jp Subject: Re: How to modify the Gdk.gc of a GDraw.pixmap ? In-Reply-To: <452EBA91.9000704 at tin.it> References: <452EBA91.9000704 at tin.it> Content-Type: text/plain; charset=us-ascii Content-Length: 930 Stalkern 2 [Thursday 12 October 2006] : > > Hello to everybody! > > 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! The GDraw.pixmap class has a gc instance variable (that comes from the parent class, GDraw.drawable). There is no accessor method for this gc field so I guess one way to do what you want is to subclass GDraw.pixmap and add your method: ,---- | class my_pixmap o = object | inherit GDraw.pixmap o | method set_dashes = Gdk.GC.set_dashes gc | end `---- (untested) -- Olivier