deinstapel / cursive-async-view Goto Github PK
View Code? Open in Web Editor NEWA loading-screen wrapper for gyscos/cursive views ๐ฅ๏ธ
License: BSD 3-Clause "New" or "Revised" License
A loading-screen wrapper for gyscos/cursive views ๐ฅ๏ธ
License: BSD 3-Clause "New" or "Revised" License
Hi,
I have the usecase where I need to build a AsyncView
from Cursive::call_on_name()
.
I'm not sure how to do that.
The usecase is: I have a sidebar with a list of items and as soon one is selected, I want to add a tab (via cursive-tabs) in the main view, loading something. The loading process can take time (minutes!), so I figured to use cursive-async-view. But because I want to create the view in Cursive::call_on_name()
, I cannot use &mut siv
to pass to the constructor of AsyncView
.
Do you have an idea how to work around this?
Is it possible to add a method like set_loading
to modify the loading
field in a AsyncView
struct?
I want to center the loading animation but find it impossible because I cannot change the default loading
field, which is a TextView
without the center
alignment option.
Would be nice if there would be an option to build the AsyncView from an iterator, with optional progress bar of course.
Something like:
AsyncView::from_iterator(it)
with from_iterator(i: I) where I: IntoIterator<Item = V>, V: View
or something like this?
Or even
AsyncView::fold_from_iter(it, ListView::new(), |accu, elem| { accu.add_child("", elem); accu });
where the closure folds over the ListView
and elem
as element from the iterator?
Hey,
so sorry for opening another issue today, but I just stumbled upon this:
[2020-06-10 22:01:24.823295 +00:00] WARN [cursive_async_view::infinite] /home/leo/.cargo/registry/src/github.com-1ecc6299db9ec823/cursive-async-view-0.3.3/src/infinite.rs:583: Refreshing thread has been dropped b
efore view has, this has no impact on your code and is a bug: sending on a disconnected channel
[2020-06-10 22:01:24.858575 +00:00] WARN [cursive_async_view::infinite] /home/leo/.cargo/registry/src/github.com-1ecc6299db9ec823/cursive-async-view-0.3.3/src/infinite.rs:583: Refreshing thread has been dropped b
efore view has, this has no impact on your code and is a bug: sending on a disconnected channel
[2020-06-10 22:01:24.859999 +00:00] WARN [cursive_async_view::infinite] /home/leo/.cargo/registry/src/github.com-1ecc6299db9ec823/cursive-async-view-0.3.3/src/infinite.rs:583: Refreshing thread has been dropped b
efore view has, this has no impact on your code and is a bug: sending on a disconnected channel
[2020-06-10 22:01:24.868513 +00:00] WARN [cursive_async_view::infinite] /home/leo/.cargo/registry/src/github.com-1ecc6299db9ec823/cursive-async-view-0.3.3/src/infinite.rs:583: Refreshing thread has been dropped b
efore view has, this has no impact on your code and is a bug: sending on a disconnected channel
[2020-06-10 22:01:24.868739 +00:00] WARN [cursive_async_view::infinite] /home/leo/.cargo/registry/src/github.com-1ecc6299db9ec823/cursive-async-view-0.3.3/src/infinite.rs:583: Refreshing thread has been dropped b
efore view has, this has no impact on your code and is a bug: sending on a disconnected channel
[2020-06-10 22:01:24.868935 +00:00] WARN [cursive_async_view::infinite] /home/leo/.cargo/registry/src/github.com-1ecc6299db9ec823/cursive-async-view-0.3.3/src/infinite.rs:583: Refreshing thread has been dropped b
efore view has, this has no impact on your code and is a bug: sending on a disconnected channel
which also promptly quit my application.
I'm not sure what happened, it is possible that my thread fetching stuff from the DB died, but I would expect some panic log in that case..
As part of the update to 0.15
cursive
has migrated their logic (and by that the parts we actually need for this crate) to cursive_core
. We should move to use this new crate, for now it requires us to move our end2end tests out of /src
into /examples
as proposed in our other view crates proposed.
As mentioned in deinstapel/cursive-tabs#5 we can make this work, but the cleaner way to handle the tests is switching to cursive::backends:puppet
in all end2end tests.
Hey!
I'm somewhat new to Rust, and I'm writing a terminal application that, among other things, loads some stuff from a database and displays it as a table. I'm using the cursive_table_view crate for the table, and that works, but I was staring at a static screen whenever I was loading new data, so I though: Why not use this cool crate to show a loading bar?
And so I did, and it works!
Now, the thing is: I load a bunch of rows in an initial query, and then I need to load additional info for each record. Which means I need to do many queries, but I know how many, so I want to display a progress bar that tells the user how far along we are.
So I simply replaced all the AsyncView
s with AsyncProgressView
s, and AsyncState
s with AsyncProgressState
s, and compilation fails.
The problem is that the table view is not Send
, so (I think) the AsyncProgressView<TableView>
is not a View
.
I could be missing something, again -- not a veteran.
Any ideas?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.