question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add ability to block call button until call has finished

See original GitHub issue

It’s currently possible to press the call button several times in a row, which will launch multiple runs one after the other - see my toy example below. For computationally intensive tasks it would be nice to be able to ‘block’ any more pressing of the call button if the main function is currently being run.

from magicgui import magicgui
import time

@magicgui(call_button="Run")
def run_timer():
    print('Asleep')
    time.sleep(2)
    print('Awake')

run_timer.show()

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
tlambert03commented, Mar 10, 2022

since this issue has already been solved for synchronous code, and an async solution is out of scope for the near-term (and there is a workaround), I’m going to close this. but feel free to open if new issues arise

1reaction
tlambert03commented, Mar 7, 2022

Sorry no, I meant you can use the same call button (we should make it public), but set it to disabled, and then connect to the threadworker finished signal to trigger a callback that re-enables the button.

Let me try to create an example later today.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Power button ends call - Android Accessibility Help
Open your device's Settings app . Tap Accessibility. Turn on Power button ends call.
Read more >
How to disable button until an async function call is over?
I want to disable the refresh button until the async method (and the REST call inside of it) is finished. How can this...
Read more >
How to end a call using the power button Samsung Galaxy s9 ...
A tutorial video demonstrates how to end a phone call by pressing the power button. Demonstrating on a Samsung Galaxy s9/so plus.
Read more >
Article - Block Spam Callers - TeamDynamix
Block Spam Callers · 1. Press the Cog button (looks like a little gear) on your Cisco phone. · 2. Select "Recents" from...
Read more >
If you can't make or receive calls on your iPhone - Apple Support
Check for any blocked phone numbers. Go to Settings > Phone > Blocked Contacts. See if Call Forwarding is turned on. Go to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found