-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get multiple, different colorized output for a list element #58
Comments
This is possible using the attribute management combinators; you can find them in the "Attribute management" section of http://hackage.haskell.org/package/brick-0.6.4/docs/Brick-Widgets-Core.html#g:5 But the easiest way is to use
and then be sure to assign those attribute map entries in your attribute map, e.g.,
You can also see some examples of the attribute API at work in If this helps, please feel free to close the issue; otherwise let me know what I can do. Thanks! |
Oh cool, I will have a look at this and report back my findings. On Wed, May 25, 2016 at 4:50 PM, Jonathan Daugherty <
|
Thanks, I got it working. I don't understand why I was thinking so narrowly before. The key is that the List widget comes with the wonderful Thanks again! |
Great! I'm glad it's working out for you. Keep in mind that if you think of something about the docs that could have made this clearer, I'm interested to know what that would be. |
Hm, maybe the docs could say that we could simulate a spreadsheet by having each element in a List widget be composed of multiple 'column' subparts, optionally colored differently? Or just implement it in a new ListDemo2.hs program? |
Actually, the existing |
Yes it does, although I think it would be clearer if visually it had something more like a spreadsheet. Shrug but then again it could be just me. Your call! |
I only hesitate to program a spreadsheet as a demo because it's such a specific application idea, and I'm concerned that having a demo app for every way to use brick would get unmanageable because it's intended to let you do whatever you want. :) With that said, I can see how it wouldn't be obvious to do what you want to do from the outset, and it will require learning the library well enough to imagine ways to get the layout you desire. My intention is to provide enough basic building blocks that just about anything can be built from them, if they are well understood. |
I agree with your concerns. Well, in the coming month(s) I will be On Thu, May 26, 2016 at 3:22 PM, Jonathan Daugherty <
|
That would be fantastic! I would be happy to add it to the README. |
Not sure if this is a question or a feature request, but please bear with me.
From what I can tell, there is no way to assign multiple color attributes to text within a single List widget element.
What I have is basically a List of multiple strings, with each string being a particular "type", much like a spreadsheet. E.g.,
and I want all the
foo
strings to be a certain color distinct from all thebar
strings, and so on.As I write this I realize that I could probably just have multiple List widgets, one for each "column" (one for
foo
, one forbar
, etc.) and assign a different color attribute for each widget (and have them aligned horizontally, right?), but is there a way to just embed different colors into a single List widget item?I feel that having multiple List widgets seems hacky and overly complicated.
The text was updated successfully, but these errors were encountered: