It's not often you see a function that takes an array of IOs and wants to do the
sequenceing for you... I'm not even sure whether that's weird or convenient. ^_^
:D Honestly I can't recall why it does that, probably convenience at some point (currently the generated bindings don't use it anymore). I could change it, but I think there are some projects using it, so perhaps not worth making it more "normal".
Hey! Is there a reason https://hackage.haskell.org/package/gi-webkit2-4.0.24/docs/GI-WebKit2-Objects-WebsiteDataManager.html#v:constructWebsiteDataManagerBaseDataDirectory is in the IO monad as opposed to MonadIO as all the other functions are?
No good reason, it should be easy to change. A pull request would be appreciated, otherwise feel free to open an issue so I don't forget to do it.
Created haskell-gi/haskell-gi#246. One day I'm bound to learn how to build Haskell GI manually and run its tests. :)
:) Thanks for the reminder! I just implemented this.
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::newdue 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!
GdkEventand 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
Eventkeyboard 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!
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
Ptrout to jam in a
Gdk.eventNew? My initial crack went with
Gtk.getWidgetWindow widgetand passing that to
withManagedPtrand then to
setEventKeyWindow, but that seems to cause GTK go haywire and delete the widget. :P
setEventKeyWindowwould take a
ManagedPtrand 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_freeor smth on it? I remember seeing the event-copy function mentioning that it increases the ref counts on its members.
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.eventNewcame 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.)