We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LibGio#g_list_store_splice
Hi! Thanks for the bindings! 🥳
When trying to #splice an Enumerable of GObjects into a ListStore, i get the following error:
#splice
Enumerable
GObject
ListStore
275 | LibGio.g_list_store_splice(to_unsafe, position, n_removals, additions, n_additions) ^-------- Error: argument 'additions' of 'LibGio#g_list_store_splice' must be Pointer(LibGObject::Object), not Pointer(Pointer(Void))
Example code snippet:
list_store = Gio::ListStore.new(Gtk::Button.g_type) one = Gtk::Button.new two = Gtk::Button.new items = [one, two] list_store.splice(position: 0_u32, n_removals: 0_u32, additions: items)
The text was updated successfully, but these errors were encountered:
In the generated bindings: gi-crystal/src/auto/gio-2.0/list_store.cr at line 271
gi-crystal/src/auto/gio-2.0/list_store.cr
- additions = additions.to_a.map(&.to_unsafe).to_unsafe + additions = additions.to_a.map(&.to_unsafe).to_unsafe.as(Pointer(LibGObject::Object))
I assume in the binding generator this is in src/generator/arg_strategy.cr but honestly, I have no idea what I'm doing 🤣
- generate_array_to_unsafe(io, arg_name, arg.type_info) + generate_array_to_unsafe(io, arg_name, arg.type_info).as(Pointer(LibGObject::Object))
I have no idea whether this breaks anything else, but it solves this issue.
Sorry, something went wrong.
This seems to be the case for all types using arg_strategy.
arg_strategy
Gdk::Paintable#snapshot_symbolic similarly needs:
Gdk::Paintable#snapshot_symbolic
- colors = colors.to_a.map(&.to_unsafe).to_unsafe + colors = colors.to_a.map(&.to_unsafe).to_unsafe.as(Pointer(LibGdk::RGBA))
Successfully merging a pull request may close this issue.
Hi! Thanks for the bindings! 🥳
When trying to
#splice
anEnumerable
ofGObject
s into aListStore
, i get the following error:Example code snippet:
The text was updated successfully, but these errors were encountered: