Kio4_Move Extension doesnt place button where I left it

When using an Any Button Clicked event, take care to wrap its innards with a test for notAlreadyHandled, to allow other more specific button Click events to work outside of this
generic logic.

Your Screen must have other buttons that you DON'T want to move when you click them, right?

thank you , i have a test if in list. removed for debugging

Im not sure if i have syntax right but i have it there.

Still experiencing bugs. buttons move, and buttons glitch back into place , but they are not positioned correctly on refresh.





This app works with not issues. I THINK I'm doing exactly the same thing within my complete app. maybe I'm still moving faster than the file can be written??

I'm going to try to trigger the file writing only when that VA is set to invisible or some other event happens, Only storing the position in the variables until.

Rather than writing to file after Kio4_move1.position block, I added a button to write file manually.
Pressing the save button after positioning prevents most of the hiccups.

there is still a small glitch: the buttons all shift about 10 pixels left or right when I write, then read the file, and they shift opposite direction on the next write, read.

It toggles back and forth and I can manage with that, by hitting the save button twice, but still a glitch.

part of my issues have been narrowed down. in another area of my blocks, i have a timer that initiates a use of some of the global variables used in this area.

i set the timerenabled to false with the initiation of a move, and i set it to true after i manually save the file, in order to prevent a double access of the variable.
it is relaying the same information, so i cannot simply use a different variable.

Rooster35.aia (165.8 KB)



@Juan_Antonio

Ive combed through my blocks a few times and ive gotten better results but I still have this issue

I get different display results depending on where at in my blocks i call for move. I believe that it is time aggravated.

2 videos show the call to move in 2 different blocks. 1 when i initialize my configuration, 2 when i initialize a virtual screen.

they initially appear in incorrect locations. they have xy coordinates on them that are copies of the xy used to set them using SET COMPONENT.

calling the initializebuttons procedure a second time AFTER A DELAY places them correctly. I tried to call the procedure back to back , getting the same results as 1 call only.

@TIMAI2 can i create a pause within a FOR EACH block to allow time for the routine to complete?

You can introduce a "pause" by using a clock timer and a counter, iterating over a list of things that have to be actioned, doing one at a time using the counter to advance through the list.

1 Like