hugopl / gi-crystal

Tool to generate Crystal bindings for gobject-based libraries (i.e. GTK)
BSD 3-Clause "New" or "Revised" License
46 stars 3 forks source link

`Gdk::FileList.new_from_array` expects `(Pointer(LibGio::File))`, not `Pointer(Pointer(Void))` #69

Open GeopJr opened 2 years ago

GeopJr commented 2 years ago

Example:

require "gtk4"

app = Gtk::Application.new("hello.example.com", Gio::ApplicationFlags::None)

app.activate_signal.connect do
  window = Gtk::ApplicationWindow.new(app)
  window.title = "test"
  window.set_default_size(200, 200)

  Gdk::FileList.new_from_array([
    Gio::File.new_for_path("/tmp/gtk4.cr/shard.yml"),
  ])

  window.present
end

exit(app.run)

raises:

In lib/gi-crystal/src/auto/gdk-4.0/file_list.cr:45:53

 45 | _retval = LibGdk.gdk_file_list_new_from_array(files, n_files)
                                                    ^----
Error: argument 'files' of 'LibGdk#gdk_file_list_new_from_array' must be Pointer(Pointer(LibGio::File)), not Pointer(Pointer(Void))