pfalcon / picotui

Lightweight, pure-Python Text User Interface (TUI) widget toolkit with minimal dependencies. Dedicated to the Pycopy project.
https://github.com/pfalcon/pycopy
MIT License
811 stars 70 forks source link

Set Widget Colors (discussion) #18

Closed peterjschroeder closed 3 years ago

peterjschroeder commented 6 years ago

It would be pretty useful to be able to set a widgets foreground and background colors outside of the library.

pfalcon commented 6 years ago

Can you please draft a "user story" for this feature?

peterjschroeder commented 6 years ago

Lets say someone wants to set a Listbox colors. Rather than the black background and a blue selector, they want a green background and a magenta selector.

When searching for a way to do this, I figured I could listbox.attr_color(C_GREEN, C_WHITE) to set the background. It doesn't seem to work that way, unless I'm doing something wrong. The selector seems to have no way to change unless you edit the hardcoded entry int the library.

I have actually imped this in my fork, but just for Listbox so far. So now all a person has to do is something like this to achieve the above:

listbox = WListBox(1, 1, items, fcolor=C_WHITE, bcolor=C_GREEN, scolor=C_MAGENTA)

ffinder

pfalcon commented 4 years ago

Can you please draft a "user story" for this feature?

Lets say someone wants to set a Listbox colors.

Yeah, let's say. But why would they want to do that?

Picotui implement a color scheme, roughly based on a well-known (in its time) Turbo Vision color scheme.

Doing things like green text and red background (or whatever) is somewhat outside the original goal of the project of being minimal and allow to develop a consistently-looking TUI apps.

In https://github.com/pfalcon/picotui/pull/30#issuecomment-702899729 I comment, that I'm not totally opposed to that, but would like more interesting projects to be tackled first, to not have concerns regarding efficiency of additions like that.

pfalcon commented 3 years ago

Closing for now as out-of-scope for the foreseeable future.