diff --git a/examples/basic.rs b/examples/basic.rs
index 4698564a..63838c49 100644
--- a/examples/basic.rs
+++ b/examples/basic.rs
@@ -1,5 +1,6 @@
use anyhow::Result;
+use ratatui::Viewport;
use termion::event::Key;
use ratatui::layout::Constraint;
@@ -107,7 +108,7 @@ pub async fn main() -> Result<()> {
})
.on_update(|_| WindowProps::default().current_page(0).to_boxed_any().into());
- tui::rm(channel, app, window).await?;
+ tui::rm(app, window, Viewport::default(), channel).await?;
Ok(())
}
diff --git a/examples/hello.rs b/examples/hello.rs
index 20e1deed..5de49408 100644
--- a/examples/hello.rs
+++ b/examples/hello.rs
@@ -1,5 +1,6 @@
use anyhow::Result;
+use ratatui::Viewport;
use termion::event::Key;
use ratatui::style::Color;
@@ -69,7 +70,7 @@ pub async fn main() -> Result<()> {
.into()
});
- tui::rm(channel, app, scene).await?;
+ tui::rm(app, scene, Viewport::default(), channel).await?;
Ok(())
}
diff --git a/examples/hello_im.rs b/examples/hello_im.rs
index 7fc553c2..3072a438 100644
--- a/examples/hello_im.rs
+++ b/examples/hello_im.rs
@@ -2,7 +2,7 @@ use anyhow::Result;
use termion::event::Key;
-use ratatui::Frame;
+use ratatui::{Frame, Viewport};
use radicle_tui as tui;
@@ -67,7 +67,7 @@ pub async fn main() -> Result<()> {
alien: ALIEN.to_string(),
};
- tui::im(Channel::default(), app).await?;
+ tui::im(app, Viewport::default(), Channel::default()).await?;
Ok(())
}
diff --git a/src/lib.rs b/src/lib.rs
index 8cafecd5..fe1bd285 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -7,6 +7,7 @@ pub mod ui;
use std::any::Any;
use std::fmt::Debug;
+use ratatui::Viewport;
use tokio::sync::mpsc::{self, UnboundedReceiver, UnboundedSender};
use serde::ser::{Serialize, SerializeStruct, Serializer};
@@ -152,9 +153,10 @@ impl Default for Channel {
/// and run their main loops concurrently. Connect them to the `Channel` and also to
/// an interrupt broadcast channel also initialized in this function.
pub async fn rm(
- channel: Channel,
state: S,
root: rm::widget::Widget,
+ viewport: Viewport,
+ channel: Channel,
) -> Result