japhb / Terminal-Widgets

Simple Raku widgets for full-screen TUIs
Artistic License 2.0
4 stars 3 forks source link

Inheriting `SpanBuffer` and `Input` #18

Open patrickbkr opened 3 months ago

patrickbkr commented 3 months ago

It's currently not possible to does both SpanBuffer and Input in the same class, as both inherit from Terminal::Widgets::Widget. But I would like to do so in my in progress RichText widget. I'm currently experimenting with not having Input be a TW::Widget, but haven't gotten it working yet.

japhb commented 3 months ago

Oh, hmm. Yeah, I probably would have hit that relatively soon myself. Hmmm, I wonder if ising one of the roles (and thus inheriting from its pun class) would be a good enough workaround for now?

Can you give that a try?

patrickbkr commented 3 months ago

I tried that already. Both can't be punned as both have a stub method. I did succeed yesterday in making Input not inherit Widget anymore though. (I simply pushed the is Widget down to the Doers of Input.)