caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Lablgtk3 & Cairo & drawing area
@ 2021-01-15 13:21 Philippe Strauss
  2021-01-15 16:25 ` Philippe Strauss
  0 siblings, 1 reply; 2+ messages in thread
From: Philippe Strauss @ 2021-01-15 13:21 UTC (permalink / raw)
  To: caml-list

Hello ocaml users,

Using previously lablgtk2, I was using Cairo_gtk to get a Cairo context from a gdkwindow:

cairo_ctx <- Some (Cairo_gtk.create (self #area) #misc #window) ;

Now I want to definitively switch to Lablgtk3. Using the following:

cairo_ctx <- Some (Cairo.create (self #area) #misc #window) ;

I get this build error:

————8<--------
- build straightliner/plwrap plot2d.cmx
+ ocamlfind ocamlopt -package lablgtk3,cairo2,plplot,plcairo,react,batteries,logs,logs-ppx -warn-error -a -thread -inline 10 -I . -I /Users/philippe/mysrc/sp_base.ml -I sigproc -I /Users/philippe/mysrc/zfilters -I plwrap -I /Users/philippe/mysrc/sp_base.ml -c plot2d.ml
File "plot2d.ml", line 132, characters 44-70:
132 |             cairo_ctx <- Some (Cairo.create (self #area) #misc #window) ;
                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: This expression has type Gdk.window = [ `gdkwindow ] Gobject.obj
       but an expression was expected of type Cairo.Surface.t
————8<--------

How do I get from a gdkwindow to a Cairo surface.t, or more generally, what is wrong with my code?

TIA, Philippe.


--
I thought I caught you stealing from my cuckoo mind
        -- The House Of Love



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-15 16:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-15 13:21 [Caml-list] Lablgtk3 & Cairo & drawing area Philippe Strauss
2021-01-15 16:25 ` Philippe Strauss

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).