Blinking Challenge - Forum

Forum Navigation
Climate strike banner
You need to log in to create posts and topics.

Blinking Challenge

I recently posted a question about a blinking button. Well, I have a new one.
How do I make text blink in a CustomWindow?

In the following code the blinking will not start until after the CustomWindow is closed. Please note: The window is Exclusive mode necessarily. Also note that Text1 is inside Container1 and contains a variable.

SetVar "[blink]" "blink"

CustomWindow "Custom Window" "-1" "-1" "Container1" "DialogBox+Exclusive+NoCloseBtn"

While "[blink]" "=" "blink"
HideObject "Text1" "None" "0"
Delay "500"
ShowObject "Text1" "None" "0"
Delay "1000"
EndWhile

In the following, the CustomWindow will not open because of the While loop.

SetVar "[blink]" "blink"

While "[blink]" "=" "blink"
HideObject "Text1" "None" "0"
Delay "500"
ShowObject "Text1" "None" "0"
Delay "1000"
EndWhile

CustomWindow "Custom Window" "-1" "-1" "Container1" "DialogBox+Exclusive+NoCloseBtn"

So, how do I make text blink in a CustomWindow in Exclusive mode?

Hello,

You may have a look at the Special subroutines for custom Windows:

See: https://winhelp.visualneo.com/Windows.html#CUSTOMWINDOW

:Container1_OnOpen 
  AlertBox "Hello" "The window is opening." 
Return

 

Regards

I've tried special subroutines before and I've rarely used it. What I think I've found is that any code in the _OnOpen subroutine essentially acts just like any code that would come before the CustomWindow action anywhere else.

So in this case, the subroutine still gets stuck in the While loop before the CustomWindow opens.

>What I think I've found is that any code in the _OnOpen subroutine essentially acts just like any code that would come before the CustomWindow action anywhere else.

I can not confirm this. For me the code of the subroutine is only executed after the custom window opened.

Regards

 

 

Hola necesitas un PushButton1, un Container1, un Text1 y un Timer1

En PushButton1.

SetVar "[blink]" ""
CustomWindow "" "-1" "-1" "Container1" "DialogBox+Exclusive"

Subrutinas

:Container1_OnOpen
TimerStart "Timer1" "500"
return

:Container1_OnClose
TimerStop "Timer1"
return

En el Timer1

If "[blink]" "=" "blink"
HideObject "Text1" "None" "0"
SetVar "[blink]" ""
else
SetVar "[blink]" "blink"
ShowObject "Text1" "None" "0"
endif
RefreshObject "Text1"

 

I messed with this a little, here is a working solution..

https://mega.nz/#!DkJSECBR!a9NRmecOwq7CahMxg0Gw0ql78l86OBYs57pKeAuYqLo

DarbDenral,
I couldn't easily reach your solution but thank you for the effort.

danito,
With a few adjustments the Timer works perfectly for what I need. Thanks.

Paul