You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to change the color of the borders of the button which the cursor is pointing on.
I am trying by this without success:
def render(self):
for key in self.master.get_widgets().keys():
if self.master.get_widgets()[key].is_selected():
self.master.get_widgets()[key].set_color(py_cui.RED_ON_BLACK)
else:
self.master.get_widgets()[key].set_color(py_cui.CYAN_ON_BLACK)
I kindly ask for little help here. What's wrong? If it is possibile to achieve it...
In the picture below I would the button "Show Yes No Popup" be colored in RED_ON_BLACK.
The text was updated successfully, but these errors were encountered:
strawberry-code
changed the title
[not-a-bug][help-requried] How to change border colors of selected buttons
[not-a-bug][help-needed] How to change border colors of selected buttons
Feb 1, 2022
strawberry-code
changed the title
[not-a-bug][help-needed] How to change border colors of selected buttons
[not-a-bug][help-wanted] How to change border colors of selected buttons
Feb 1, 2022
How are you calling the above function? By default, py_cui interfaces will only re-draw when an action is performed (key press, mouse press). If you want that function to be run periodically, you can use the set_on_draw_update_func() to run the render function on every draw call, and then unlock periodic re-draw of the screen with set_refresh_timeout(). Note that the function set with set_on_draw_update_func() is fired at the start of the draw loop, before the new widget is considered selected.
It may be worthwhile to allow for setting a function to fire per draw call both at the start and end - that would simplify this
I am trying to change the color of the borders of the button which the cursor is pointing on.
I am trying by this without success:
I kindly ask for little help here. What's wrong? If it is possibile to achieve it...
In the picture below I would the button "Show Yes No Popup" be colored in RED_ON_BLACK.
The text was updated successfully, but these errors were encountered: