mirror of
https://github.com/rr-/pq-cli.git
synced 2026-09-29 06:44:00 -06:00
17 lines
421 B
Python
17 lines
421 B
Python
import urwid
|
|
|
|
|
|
class ReadOnlyCheckBox(urwid.Text):
|
|
def __init__(self, text, state: bool = False) -> None:
|
|
self.icons = {
|
|
key: widget.text for key, widget in urwid.CheckBox.states.items()
|
|
}
|
|
self._caption = text
|
|
|
|
super().__init__("")
|
|
|
|
self.set_state(state)
|
|
|
|
def set_state(self, state: bool) -> None:
|
|
self.set_text(self.icons[state] + " " + self._caption)
|