Flashing Button / LAF
-
Do-able?
-
@DanH use a timer...
-
@Lindon in the LAF callback? Will give it a shot. Thinking about the timer though (and I'm probably being stupid), how do I script the timer to do something and then do the opposite / something else every other second (for example)?
-
@DanH - I wouldnt do it in the LAF, but the logic is pretty simple:
myButton.setValue(1 - myButton.getValue());
-
-
@DanH said in Flashing Button / LAF:
@Lindon in the LAF callback? Will give it a shot. Thinking about the timer though (and I'm probably being stupid), how do I script the timer to do something and then do the opposite / something else every other second (for example)?
Not with custom LAF because that would mean using an external variable which isn't recommended.
If you make your button with a panel it is easy though:
- Invert a bool inside the timer at the time interval you wish
bool = !bool;
- Repaint the panel and use the bool to do what you want (change colour or anything fancier)
- Invert a bool inside the timer at the time interval you wish
-
@ustk Thansk! I ended up using a panel 2 timers which turn eachother on / off and show / unshow the panel.
How would I script the bool?
-
HiseSnippet 984.3ocsVEtaaaCDlxNZn1acXEnO.p8WJadBRowosXXXYwwYvXKoFyYcCXnnfgh1hHTjpjT0yXnuK6QbuAaGEkijybCJLVMjkMu69H+zw69nlpjDpVKUHudWtpfh79L+YqDlrQYXl.M4Tj2m6eNVanp.moSVUf0ZZJxyq6OXM30aOT0m+96NAywBBswDB8RIiP+IVNyzXc5w+HiyOCmRujk2J5COdBQJFI4xRfOc8iQEXx03EzKv1v53i79jwoLiTMyfMTMxauSjoqlkIWJbw+RllcEmZGjflASjy7YRdpkwVqnQYLd5z0O2ZDLKSaxBccYgG5eNKkci8lrwWT4HnAQ67gWmMoW2MnWRa5E2hdagRdsnzdNJ8.+YDEqvz3wxmO0eh.1bligzdap3hE04u55ORBQHLQ43qomofA2fH7n33AAvs8+l98gTu1D7VrJXJVP4IAeavZjKnlQx7Bo.FD9Xm6GCXb+KJEavQEshmnnPBXJ1jEZm41goyYbJDpQURabooloPF17yxRCSPCmWJHFlTDtX+9+Y+dKrA3pKBc+niVlwfbbt7ZJrDPDoJ7xwbNqPSC+8ChFNv9M44Uee0ffgQwt3lCkd2D2v3Av0SrWAeUfIioawxuL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