Comments (7)
Try this
@ui.in_background
def copy_action(sender):
#clipboard.set(sender.superview['label1'].text)
#hud_alert('Copied')
import console
if console.alert('Copy warning'):
clipboard.set(sender.superview['label1'].text)
hud_alert('Copied')
from pythonista-issues.
I can't find the topic, bad search arguments I guess, if you could already read this one https://forum.omz-software.com/topic/1156/console-input_alert-freeze
from pythonista-issues.
And this one https://forum-new.omz-software.com/topic/1119/can-t-show-an-alert/2
from pythonista-issues.
Here’s a reproducible case.
Open up the example file called “ColorMixer.py” under “User Interface”.
Change this function:
def copy_action(sender):
clipboard.set(sender.superview['label1'].text)
hud_alert('Copied')
To this:
def copy_action(sender):
if console.alert('Copy warning'):
clipboard.set(sender.superview['label1'].text)
hud_alert('Copied')
The script will hang when you press the ‘Copy’ button.
from pythonista-issues.
Thanks! This fixed the problem in my script!
Does this mean @ui.in_background is how you should do it, or is it a workaround?
from pythonista-issues.
In the past, we did not need this line except in some cases, thus it is a workaround and you could find a very good explanation of @JonB in the forum, if I find it again, I'll post it here
from pythonista-issues.
Thanks :)
from pythonista-issues.
Related Issues (20)
- NumPy does not work HOT 1
- Can we have Scripy included in the next version? HOT 2
- Pythonista Forum HOT 5
- Bug in Pythonista JPG Decoding HOT 3
- Japanese characters changed on paste in Editor
- Displaying modal Scene from Scene that has no children gives `max() arg is an empty sequence` error HOT 2
- Feature: Widget Interaction
- Please add a GitHub Discussion
- Making apps
- See Hidden Files HOT 2
- Pythonista hangs on opening Photo Library HOT 9
- Keyboard - Haptic Feedback
- Access to OpenAI’s GPT4 not working HOT 11
- Using sound.recorder causes volume of speech.say to become very low HOT 2
- py_ssize_t_clean macro must be defined for '#' formats | Module CB HOT 1
- Folders with subfolders and submodules named the same cause import problem
- Adding folder in SD card to EXTERNAL FILES section will fail and show error
- contacts.phone not filled
- will_close() and wait_modal() not working on presented view
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pythonista-issues.