Commit 8065dc0d authored by Fjen Undso's avatar Fjen Undso
Browse files

gui/checkbox: add unfocused toggle_key

parent e784164a
......@@ -3,9 +3,11 @@ from .abstracts.drawable import Drawable
class CheckBox(Drawable):
def __init__(self, *, window, row=0, col=0, text=None, toggle_key=None):
def __init__(self, *, window, row=0, col=0, text=None, toggle_key=None,
toggle_key_unfocused=None):
self.text = text
self.toggle_key = toggle_key
self.toggle_key_unfocused = toggle_key_unfocused
self.active = False
Drawable.__init__(self, window=window, row=row, col=col)
......@@ -21,6 +23,9 @@ class CheckBox(Drawable):
self.window.refresh()
def send_key(self, key):
if key == self.toggle_key_unfocused:
self.toggle()
if not self.focus:
return
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment