The MVC and Command templates should work here. The main idea is that you need to send a “message” (which may be an object or a string or something really) in the GUI to notify about it, to change its state and how to do it. You just have to be careful to take into account any delays that may occur when receiving and processing a GUI message.
You can create a queue of events (associated with commands) and make sure that the first of them is the first (because of the queue). Then follow the GUI process of the next event in the queue, this will ensure that the GUI is updated before starting another event to do what you were just trying to disable. You can then report the error or ignore it or something else. In any case, the user will not be able to do something as soon as the team disables this functionality. Disabling the GUI button is just a visual effect, and for commands in the background there should be a warning code that really does your job.
source share