Re: Undocumented behaviour of Edit control's gLabel
Posted: 28 Sep 2017, 21:08
Thanks, looks like the surefire way is to use +/-g in combination with sleep -1. edit: on second thought, sleep -1 is no good for me because my gEdit's need to be Critical, and sleep -1 forces an interruption.
But there is still another gotcha: inside the gEdit, when checking to see if the user entered a legal character/string, and if not, then correcting and updating the control to a legal value. Updating the control within its own glabel will then trigger itself again, and cannot be avoided with Critical since WM threads override Critical. edit: on further testing that doesn't seem to be the case, which in this case is bad because it means no amount of sleep can wait long enough for the WM to arrive. In that case I thought to do +/-g trick, however I'm not sure what happens when you turn off a glabel from within a glabel - whether ahk would allow the glabel to complete first or not.
But there is still another gotcha: inside the gEdit, when checking to see if the user entered a legal character/string, and if not, then correcting and updating the control to a legal value. Updating the control within its own glabel will then trigger itself again, and cannot be avoided with Critical since WM threads override Critical. edit: on further testing that doesn't seem to be the case, which in this case is bad because it means no amount of sleep can wait long enough for the WM to arrive. In that case I thought to do +/-g trick, however I'm not sure what happens when you turn off a glabel from within a glabel - whether ahk would allow the glabel to complete first or not.