garetxe on master
haskell-gi-base 0.26.3 haskell-gi-0.26 Fix for nullable parameter in r… (compare)
(transfer null)
in the introspection data, which means that managing its memory becomes the responsibility of the widget. And in particular, haskell-gi
has no way of knowing if the underlying pointer it's alive after the call (well, currently, in principle it could detect it, but I haven't implemented it yet).
I have callbacks of the form
void $ GTK.afterGestureClickPressed viewportClicksController
( handleMouseButtonEvent viewportClicksController )
which monitors clicks in a certain drawing area for user interaction over that area
handleMouseButtonEvent gestureClick nbClicks x y
has code like do { button <- GTK.gestureSingleGetCurrentButton gestureClick; handleAction (MouseClick (Point2D x y) button nbClicks) }
, usual stuff really
self
argument in the callback somehow), but I need to think about the best way to expose this in the bindings
source-repository-package
stanza to my cabal.project
pointing to that commit but I can't do that here, could you advise?
haskell-gi
and haskell-gi-base
from github, the bindings themselves (the gi-*
packages) in hackage should be OK. Just make sure that they are regenerated (removing your .dist-newstyle
should do the job).
Is there an example project or howto how to use GTK4 + haskell-gi and stack?
Unfortunately nothing that I am aware of. It should be possible to do by adding enough packages to your stack.yaml
, there is some relevant discussion in haskell-gi/haskell-gi#339
cabal
before going into that. At least for building haskell-gi
generated bindings it is often easier with cabal
.
How would you translate
new Gtk.Window [ On #destroy Gtk.mainQuit ]
`
to code that doesn't use labels?
new
(from GI.Gtk) without specifying the bins type, i don't seem to be able to
myNew = new
(with GI.Gtk in scope)
• Overlapping instances for GI.Constructible a0 tag0
arising from a use of ‘GI.new’
Matching instances:
instance [overlappable] (GI.GObject a, tag ~ 'GI.AttrConstruct) =>
GI.Constructible a tag
-- Defined in ‘Data.GI.Base.Constructible’
instance (tag ~ 'GI.AttrSet) =>
GI.Constructible G.AccelGroupEntry tag
-- Defined in ‘GI.Gtk.Structs.AccelGroupEntry’
instance (tag ~ 'GI.AttrSet) => GI.Constructible G.AccelKey tag
-- Defined in ‘GI.Gtk.Structs.AccelKey’
...plus 35 others
...plus 95 instances involving out-of-scope types
(use -fprint-potential-instances to see them all)
(The choice depends on the instantiation of ‘a0, tag0’
To pick the first instance above, use IncoherentInstances
when compiling the other instance declarations)
• In the expression: GI.new
In an equation for ‘myNew’: myNew = GI.new
|
97 | myNew = G.new
| ^^^^^