Comments (6)
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.
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.
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.
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.
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.
Sounds great, thanks for looking into this :)
from gtk4-rs.
Related Issues (20)
- [HELP]
- Invalid property: GtkApplicationWindow.window-position HOT 1
- glium_gl_area: Doesn't work with GTK 4.14
- [HELP] High memory HOT 1
- Chapter 9 missing derived_properties and subclassing
- Fuzzy font on Windows HOT 1
- gtk::DragIcon::for_drag returns Widget, not DragIcon HOT 5
- glib::Regex forced main thread to panic at the end of while loop HOT 1
- custom_orientable example emits critical warning when run
- No method named `dispose_template` found for reference `&custom_buildable::imp::CustomBuildable` in the current scope HOT 3
- The target object of type SqueezerBin has no writable property called 'keep-aspect-ratio' HOT 8
- Is it possible to improve compile times? HOT 1
- Compiler error when using `enum` subclasses of Object as properties HOT 1
- CSS opacity not respected for window HOT 1
- Accessing GtkWidget class methods HOT 1
- Support for dark mode HOT 1
- Book: Issue with glib::spawn_future_local in gtk-rs Chapter 6 HOT 5
- [BOOK] Chapter 15 should have adwaita-icon-theme included in macOS install command HOT 1
- Should connect_unrealize and connect_destroy be FnOnce() rather than Fn()? HOT 1
- Segfault if trying to use certain builders before GTK is initialized
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gtk4-rs.