Giter VIP home page Giter VIP logo

Comments (6)

bilelmoussaoui avatar bilelmoussaoui commented on August 16, 2024

Shouldn't be needed because we do support composite template in gtk4-rs, see the following example https://github.com/gtk-rs/gtk4-rs/blob/master/examples/src/bin/composite_template.rs

from gtk4-rs.

sdroege avatar sdroege commented on August 16, 2024

If such a script provides more than that and makes things easier, the best approach would probably be to make it a proc macro (you can read the .ui files from the macro code) so it can be directly integrated into the Rust code instead of having external code generation via build.rs (which is rather suboptimal build-system-wise).

from gtk4-rs.

felinira avatar felinira commented on August 16, 2024

Yes, rewriting it as macros was the idea. I just didn't want to do it before getting feedback about it. Composite templates don't check your actual ui files for any errors or typos, do they? These errors are only caught at runtime which makes it impossible to catch by CI etc. And you still need to write the template files.

from gtk4-rs.

bilelmoussaoui avatar bilelmoussaoui commented on August 16, 2024

Yes, rewriting it as macros was the idea. I just didn't want to do it before getting feedback about it. Composite templates don't check your actual ui files for any errors or typos, do they? These errors are only caught at runtime which makes it impossible to catch by CI etc. And you still need to write the template files.

Definitely, see my suggestion in #77, Vala does exactly the same thing by having an attribute to specify either a resource uri or a file path and it does check the types at build time that way.

from gtk4-rs.

felinira avatar felinira commented on August 16, 2024

Ah yes that looks like a good way to do it. I guess three LOC per template file are a good compromise between magic and not having to write a lot of code. I can look into it.

from gtk4-rs.

sdroege avatar sdroege commented on August 16, 2024

Sounds great, thanks for looking into this :)

from gtk4-rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.