diff options
Diffstat (limited to 'widget/src/helpers.rs')
-rw-r--r-- | widget/src/helpers.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/widget/src/helpers.rs b/widget/src/helpers.rs index 4863e550..1b57cd21 100644 --- a/widget/src/helpers.rs +++ b/widget/src/helpers.rs @@ -51,6 +51,19 @@ macro_rules! row { ); } +/// Creates a new [`Text`] widget with the provided content. +/// +/// [`Text`]: core::widget::Text +#[macro_export] +macro_rules! text { + () => ( + $crate::Text::new() + ); + ($($arg:tt)*) => { + $crate::Text::new(format!($($arg)*)) + }; +} + /// Creates a new [`Container`] with the provided content. /// /// [`Container`]: crate::Container |