garetxe on master
Support deprecated "allow-none"… (compare)
garetxe on master
Espace arguments named "_" (thi… (compare)
garetxe on master
Escape variables named "_" Merge branch 'master' of github… (compare)
Do you yourself use Haskell GI to build an end-user facing GTK app, too, or have you just ended up responsible for it without actually using it in anger? :)
I actually started working on this because I wanted to play with GUIs in Haskell, but then got distracted writing haskell-gi
itself :) (based on some prior work by Will Thompson). These days I spend most of my time on the bindings themselves, although sometimes I do write small apps for personal use.
XXX Could not generate method Schema::new
due to missing support for some GHashTable methods. Probably easy to add, could you please open an issue so I don't forget to look into this? Thanks!
GdkEvent
and filling in its keyboard properties (http://hackage.haskell.org/package/gi-gdk-3.0.22/docs/GI-Gdk-Unions-Event.html). I don't, however, see any way to set the Event
keyboard modifiers. They are available in http://hackage.haskell.org/package/gi-gdk-3.0.22/docs/GI-Gdk-Structs-EventKey.html, but not in the more general event type. Any idea what's going on there? Thanks in advance!
mainDoEvent
(https://hackage.haskell.org/package/gi-gtk-3.0.32/docs/GI-Gtk-Functions.html#v:mainDoEvent) seems to strictly want an Event
, too, so going with EventKey
doesn't seem to do the trick.
Ptr Window
. Which of the https://hackage.haskell.org/package/haskell-gi-base-0.23.0/docs/Data-GI-Base-ManagedPtr.html functions seem appropriate to you to get a Ptr
out to jam in a Gdk.eventNew
? My initial crack went with Gtk.getWidgetWindow widget
and passing that to withManagedPtr
and then to setEventKeyWindow
, but that seems to cause GTK go haywire and delete the widget. :P
GdkEventKey
struct.
setEventKeyWindow
would take a ManagedPtr
and call ref on it itself.
:&=
operator (see https://hackage.haskell.org/package/haskell-gi-base-0.23.0/docs/Data-GI-Base.html) work?
:&=
says that it is fine to allocate
It is a struct, but isn't GTK free-ing all related ref counted fields if one calls its
g_object_free
or smth on it? I remember seeing the event-copy function mentioning that it increases the ref counts on its members.
Unfortunately haskell-gi
cannot know this, from the point of view of the introspection data there is no information saying "this field will be freed when the struct is freed". So we have to play it safe
I suppose technically Haskell GI could ensure no-leaks if it ensured the return value of
Gdk.eventNew
came with a finalizer that unref-ed the event which in turn would, presumably, unref its fields.
Yeah, but this would mean treating GdkEvent
specially, and I want to keep my sanity :) Luckily gtk4
fixes this to a large extent, GdkEvent
gains accessor functions with well defined memory management.
Elsewhere there is referencing introspection? So far Haskell GI seems to know when you ref things. :P
Yes, the problem is that is is a struct field. Generally we can do things nicely when there is a setter function, but this is not the case (generally) for struct fields
:&=
papers over this complication.)