Closed ahenshaw closed 1 year ago
Thank you for contributing again.
I intended to keep this library very thin as much as I can, but adding From
impl to manually implemented binding of wxArray<wxString>
is good idea.
Converting from Display
trait may have a little overhead, so let me think a bit, please.
Thanks a lot!
I've added a "From" trait to wx::ArrayString that allows it to be initialized by any type that implements IntoIterator and for any item that implements the Display trait. This allowed me to clean up a lot of code in the samples.
So, instead of
you can just do :
let x = wx::ArrayString::from(["1", "2"]);
or even better:
let x = ["1", "2"].into();
when the compiler can figure out that x is an ArrayString (which happens a lot in the sample code).You can also do things like:
wx::RadioBox::builder(Some(&self.base)).choices((1..3).into()).build()
because integer types implement the Display trait.