jhass / crystal-gobject

gobject-introspection for Crystal
BSD 3-Clause "New" or "Revised" License
127 stars 13 forks source link

Samples don't compile #10

Closed AlexWayfer closed 4 years ago

AlexWayfer commented 7 years ago

Hello!

I've tried gtk_hello_world and gdk_window samples, but they don't compile:

Error in src/shine-panel.cr:6: instantiating 'Gtk::Window:Class#new()'

 window = Gtk::Window.new
                      ^~~

in lib/gobject/src/gtk/gtk.cr:47: instantiating 'new(LibGtk::WindowType)'

      new LibGtk::WindowType::TOPLEVEL
      ^~~

in lib/gobject/src/generated/gtk/window.cr:50: instantiating 'cast(Gtk::Widget)'

      cast Gtk::Widget.new(__return_value)
      ^~~~

in lib/gobject/src/generated/gtk/window.cr:4: expanding macro

  class Window < Bin
  ^

in macro 'inherited' expanded macro: included:1, line 3:

   1.         # Add run-time check
   2.         def self.cast(object) : self
>  3.           new(object.to_unsafe as LibGtk::Window*)
   4.         end
   5.       

wrong number of arguments for 'Gtk::Widget#to_unsafe' (given 1, expected 0)
Overloads are:
 - Gtk::Widget#to_unsafe()
 - GObject::InitiallyUnowned#to_unsafe()
 - GObject::Object#to_unsafe()

Crystal version is 0.20.3 GTK 3.22.6

Thanks.

jhass commented 5 years ago

Hey, could you check again with latest versions?

AlexWayfer commented 4 years ago

jhass closed this 8 hours ago

Why? Is it resolved?

jhass commented 4 years ago

For me they compile and you've been silent to my question above, so I assumed it works for you now or you don't care anymore.

AlexWayfer commented 4 years ago

Oh, sorry, my bad.

AlexWayfer commented 4 years ago

Yes, I confirm: current master with Crystal 0.32.1 on Arch Linux works.

Thank you.