Window 'flashing' when changing location or size using code
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Window 'flashing' when changing location or size using code
Hi,
Ive been trying to find the answer to this everywhere!
I have a simple piece of code which stores the left, top, width and height of a stack in a text file next to a user name
When a user starts the software, then get a login screen, select a use and the software then loads the 'main' form. During the load it sets the height, width etc to the location the user previously used.
Problem is the window flickers and jumps around while the commands are being done.
Ive tried putting a lock screen message before issuing the commands, and putting them in the logon code, the preopenstack and the openstack handlers, but they are all pretty much the same.
Is there any way to stop the flickering, or perhaps to set the stack width, height and location in one step to reduce it?
Thanks
Andy
Ive been trying to find the answer to this everywhere!
I have a simple piece of code which stores the left, top, width and height of a stack in a text file next to a user name
When a user starts the software, then get a login screen, select a use and the software then loads the 'main' form. During the load it sets the height, width etc to the location the user previously used.
Problem is the window flickers and jumps around while the commands are being done.
Ive tried putting a lock screen message before issuing the commands, and putting them in the logon code, the preopenstack and the openstack handlers, but they are all pretty much the same.
Is there any way to stop the flickering, or perhaps to set the stack width, height and location in one step to reduce it?
Thanks
Andy
-
- VIP Livecode Opensource Backer
- Posts: 10049
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Try putting the window adjustment stuff in a preOpenStack handler rather than openStack. That way all those things are taken care of before the window is rendered to the screen.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Thanks for the suggestion.
I tried that, but what appears to happen is the window is displayed in the last position (in the compiled version thats always the position it was in on my machine), then disappears and reappears in the new position.
Its like the first command is forcing the window to draw.
Andy
I tried that, but what appears to happen is the window is displayed in the last position (in the compiled version thats always the position it was in on my machine), then disappears and reappears in the new position.
Its like the first command is forcing the window to draw.
Andy
I think ive found a better command for the left and top settings..
set the topleft of stack "diary" to gProgLocation["left"], gProgLocation["top"]
In the preopenstack this is much better than setting the left and top positions separately.
Is there are similar single command to set the width and height?
set the topleft of stack "diary" to gProgLocation["left"], gProgLocation["top"]
In the preopenstack this is much better than setting the left and top positions separately.
Is there are similar single command to set the width and height?