hugopl / gtk4.cr

GTK4 bindings for Crystal
https://hugopl.github.io/gtk4.cr/
MIT License
101 stars 8 forks source link

Add more options to `register_resource` #29

Closed GeopJr closed 2 years ago

GeopJr commented 2 years ago

On Collision I use the --sourcedir flag while compiling resources with glib-compile-resources. Should register_resource accept an extra parameter for it or maybe just an extra parameter for extra flags?

eg.

  macro register_resource(resource_file, flags)
    {%
      `glib-compile-resources #{flags} --target crystal-gio-resource.gresource #{resource_file}`
...

register_resource("./data.gresource.xml", "--sourcedir data")
hugopl commented 2 years ago

source dir is default to project dir, would be nice to have an extra option for data but I prefer the syntax:

register_resource("./data.gresource.xml", sourcedir: "data")