bodil / vgtk

A declarative desktop UI framework for Rust built on GTK and Gtk-rs
http://bodil.lol/vgtk/
Other
1.05k stars 37 forks source link

Creating two Entry components inside a Box triggers a recursion error #74

Closed doggge77 closed 3 years ago

doggge77 commented 3 years ago

If you have something like

<Box>
  <Entry ... />
  <Entry ... />
</Box>

I get this error

error: recursion limit reached while expanding `$crate::dispatch!`
  --> src/app.rs:60:5
   |
60 | /     gtk! {
61 | |       <Application::new_unwrap(Some("com.example"), ApplicationFlags::empty())>
62 | |         <Window border_width=20 on destroy=|_| Message::Exit>
63 | |           <Box spacing=10 orientation=Orientation::Vertical>
...  |
74 | |       </Application>
75 | |     }
   | |_____^
   |
   = help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`example`)
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to previous error

Of course If I add #![recursion_limit="256"] to my crate, it works. Or if I remove one of the entry's it work.s

pepijndevos commented 3 years ago

It's not a bug, it's a feature. This is mentioned in the tutorial, and expected.

doggge77 commented 3 years ago

Ok makes sense. Would be nice to document that somewhere in the code or readme rather than an external website.