gre.delete_control does not issue a repaint

Questions and information about using Lua scripting with Storyboard

Moderator: jamiev

gre.delete_control does not issue a repaint

Postby anba » Thu Mar 23, 2017 6:46 am

Hello,

when I issue gre.delete_control("layer.control") the object is deleted internally, but screen is not updated accordingly.
My current workaround is fetching the control pos and size before, then issuing the gre.delete_control(...) and afterwards call gre.redraw(...) with the x, y, width, height of the deleted control.

So it is possible to work with, but is this working as intended?

Thanks,
Andreas
anba
 
Posts: 12
Joined: Fri Nov 18, 2016 2:10 am

Re: gre.delete_control does not issue a repaint

Postby JohnW » Thu Apr 06, 2017 2:52 pm

Hi anba,

I've tried to duplicate this locally bu have been unable to. I have a couple questions first.

1. Which version of Storyboard are you using,
2. Are you trying to delete cloned controls?
3. Can you share the function in which this behavior seems to be happening?
4. Is this on a scrolling layer perhaps?
User avatar
JohnW
 
Posts: 56
Joined: Wed May 08, 2013 4:52 pm

Re: gre.delete_control does not issue a repaint

Postby anba » Mon Apr 10, 2017 1:07 am

Hi John,

1. I was using Storyboard v4.2, but recently updated to v5.0. Same behavior in both versions.

2. Yes these controls were cloned before by gre.clone_control("original", "clone", "target_layer", control_data)
When I then try to gre.delete_control("clone") nothing happens on the screen, even though the control is internally removed.

3. I tested the behavior in a minimalist example myself and I was unable to reproduce the issue at first. Further digging showed that this only occurs when the original control is located on another screen than the clone. I will attach a small example application showing the failure case.

4. No scrolling layer - just a standard fullscreen layer


In the example the keyboard key presses for c, d, and r are handled:
c - clone control
d - delete clone
r - redraw

clone_delete_test.zip
(76.49 KiB) Downloaded 19 times


Thank you,
Andreas
anba
 
Posts: 12
Joined: Fri Nov 18, 2016 2:10 am

Re: gre.delete_control does not issue a repaint

Postby JohnW » Thu Apr 13, 2017 9:36 am

Hi Andreas,

Thank you very much for the sample it helped a lot and I was able to reproduce the issue here. It has been logged as a bug. As far as work arounds you are correct. Sending the redraw event is exactly the way to get by this. I'll update this forum post when this bug is fixed
User avatar
JohnW
 
Posts: 56
Joined: Wed May 08, 2013 4:52 pm


Return to Lua Scripting

Who is online

Users browsing this forum: No registered users and 1 guest