dankamongmen / notcurses-rs

high-level rust wrappers for notcurses, built around libnotcurses-sys
Other
50 stars 3 forks source link

widgets don't use notcurses-rs types #2

Closed drbeefsupreme closed 1 year ago

drbeefsupreme commented 1 year ago

First, thanks for building this!

I am trying to get my bearings. I noticed that the widgets in libnotcurses-sys aren't re-exported here, and I don't see a clear way to use notcurses-rs types with them - e.g. I can't hand NcSelector::new a Plane, I have to give it a NcPlane, and I don't see a way to get the NcPlane from a Plane. So my impression is that I need to deal with both notcurses-rs types and libnotcurses-sys types, when my expectation was that just notcurses-rs ought to be sufficient.

What's the intended way to go about things here? Is there actually no way to use widgets with e.g. Planes, is it a feature intended for the future, is it somehow wrong to do it this way because of some convention, etc? I am still very new to Rust so I could be missing something obvious. But this also seems like something that might just barely be within my ability to do myself, since I'm guessing we just need some wrapper functions.

joseluis commented 1 year ago

Hi there! thanks for your feedback,

Yes, notcurses-rs ought to be sufficient without the lower level library, but the thing is I haven't implemented the widgets yet. I remember having some troubles making them work perfectly in libnotcurses-sys a long time ago and left them parked for a future time. I guess the time has come to try to take a new stab at it so I've created a new issue #3 to keep track of their implementation and I'm gonna see how soon I can work on it.

I also wanted to change and simplify some other parts of the API, like the input events, during this year, so expect some bumps on the road until the next stable version 4...

drbeefsupreme commented 1 year ago

Thanks, if you accept pull requests I might take a stab at this sometime later this month.

joseluis commented 1 year ago

Sure, that'd be great.

drbeefsupreme commented 1 year ago

Great, I'll post in #3 if I end up making any progress.