Closed cedlemo closed 3 years ago
Thanks for letting me know about this (my name is mistyped in the referenced issue) and for working on this. I know little about Gtk3 but that looks to me like a valid approach. On the OCaml side, the question is how widget
will be made available in the new Gtk3 bindings — otherwise some helper functions such as gtk_widget_get_allocated_width
, gtk_widget_get_allocated_height
, gtk_widget_get_style_context
, gtk_render_background(context,cr,0,0,width,height)
,... must be made available.
I know little about Gtk3 but that looks to me like a valid approach nice !
On the OCaml side, the question is how widget will be made available in the new Gtk3 bindings
Sorry I am not sure to fully understand your answer. At first glance, there will be no significant change compared to Gtk2
.
gtk_widget_get_allocated_width, gtk_widget_get_allocated_height, gtk_widget_get_style_context, gtk_render_background(context,cr,0,0,width,height),... must be made available.
Ah yes of course, I will have to find all the functions that use or that are needed to use a CairoContext
.
At first glance, there will be no significant change compared to Gtk2.
I have only looked at a glace so I may be wrong but, with the old binding, the Cairo
module alone was responsible for the representation of Cairo.context
. Now Gtk3
bindings and Cairo
modules must agree on the representation on the OCaml side (Cairo
installs cairo_ocaml.h
so a dependency of Gtk3
on Cairo
is possible).
Ah my bad I misundertood you. I thought that you were talking about Gtk::Widget
( the question is how widget will be made available in the new Gtk3 bindings).
Sorry. What I meant is that, in order to use Cairo properly, some information (width, height,...) that requires a widget
argument is needed. If it is Cairo that must call Gtk3, then widget
(including its C bindings headers) must be available.
Dear Chris00, please have a look at lablgtk issue 6 again. I have a first "working" implementation (I can run gtk-demo.exe in examples-gtk on lablgtk3), but it uses an Obj.magic and an hard decision must be taken between you and Jacques before I can submit pull requests to both of you.
@sacerdot Anything left for me to do?
@sacerdot Gentle ping.
Hi Chris. Not as long as I remember. I think that this issue can be closed.
I am trying to help to update lablgtk in order to support gtk3. Currently (https://github.com/garrigue/lablgtk/issues/6#issuecomment-390555172) I try to add the
draw
signal for widgets :My first idea was to add an OCaml CairoContext type based on the same C code of OCaml-Cairo so that we will be able to use your module in the callback. I would like to know your thoughts about it.