Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable Components While Their Event is Processed #31

Open
ddrake12 opened this issue May 8, 2017 · 1 comment
Open

Disable Components While Their Event is Processed #31

ddrake12 opened this issue May 8, 2017 · 1 comment

Comments

@ddrake12
Copy link

ddrake12 commented May 8, 2017

For long running actions, it would be helpful to have a built-in way to disable components while their event is processed. For example, currently the user could press a button multiple times while the first long running action is happening creating successive events using the same selections on the GUI.

I have used the following workaround for a button (which can be extended for other components/paradigms):

Use a timer to continually call MarkDirty() on the button, then on the button click event run a long running action in a goroutine (which will return immediately). Calls to SetEnabled() within the goroutine will be updated as quickly as the timer repeats..

@powerslacker
Copy link

Don't mean to resurrect the dead here -- but you could use a sync.Mutex to lock the button down, so multiple presses would have no effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants