Message-ID: <452F45BC.1090600 at tin.it> Date: Fri, 13 Oct 2006 09:52:28 +0200 From: Stalkern 2 MIME-Version: 1.0 To: lablgtk at math.nagoya-u.ac.jp Subject: Re: How to modify the Gdk.gc of a GDraw.pixmap ? References: <452EBA91.9000704 at tin.it> <452EC8E8.5080903 at rftp.com> In-Reply-To: <452EC8E8.5080903 at rftp.com> Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=ISO-8859-1 Content-Length: 1270 Robert Roessler wrote: > 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 lines. > OK, now I see, I have to draw with a function accepting a Gdk.gc, like Gdk.Draw.line : [> `drawable ] Gobject.obj -> Gdk.gc -> x:int -> y:int -> x:int -> y:int -> unit Thanks A LOT (thanks A DOT?) :-)) Ernesto