Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Another dialogue issue
-
@Tel Did you try to remove Pythonista from the active apps (what we call restart Pythonista) by swiping from bottom middle and then swiping the app above?
Sorry if it is an obvious question but sometimes, restart Pythonista doesn't have the same meaning for all people. -
@cvp absolutely. It’s the only way to get rid of the running app. Unless you know another way...?
-
@Tel No, you're right.
Now, you say that Pythonista hangs, that will say that you can't do anything with it?
-
@Tel did you try "Pythonista3://" in Safari?
-
@cvp I don’t understand doing it in Safari, but it doesn’t help.
Cannot do anything with Pythonista when it hangs. -
@Tel could you check this:
- remove Pythonista from active apps
- settings/Pythonista/safe mode
-
@cvp I did that. It still hangs.
-
@Tel Very strange.
I don't know if you have taken a backup before your upgrade to 12.4.1. If yes, restore it.
I don't know if you have vital scripts or data. If no, reinstall Pythonista. -
@cvp thanks for your help. I’m going to see if anyone else has ideas before I give up on the project.
-
@Tel said:
Cannot do anything with Pythonista when it hangs.
Sorry, to insist.
You say "when it hangs".
But does Pythonista hang immediately or only when you start this script? -
@cvp it hangs when I run this script, after it displays the form dialog
-
@Tel ok, sorry, I had understood that Pythonista did hang at its start and that you can't do anything. My fault, thus not so vital 😀
-
@Tel did you try
@ui.in_background def parse(st) :
-
@cvp better, but not working correctly. Try this, you will see that the NewLink ()returns None before the input is processed
import sys, dialogs import ui import console global theView class MyView(ui.View): last_content_offset = (-1,-1) def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.make_view() self.value = None def make_view(self): self.tv= ui.TextView(title='textview1', frame=self.bounds.inset(10,10),editable = False, border_width=2, bg_color='white', flex='hw') self.update_interval = 1/60 self.tv.height = self.bounds.height-70 self.add_subview(self.tv) tf = ui.TextField(frame = self.bounds.inset(10, 10), text_color='red') #print (self.bounds) tf.frame=(10,240,self.bounds.width-20,40) tf.height =32 tf.delegate = self tf.flex = 'w' tf.begin_editing() self.add_subview(tf) def update(self) : self.tv.content_offset = (0, self.tv.content_size[1] - self.tv.height) if self.tv.content_offset[1] < 0: self.tv.content_offset = (0,0) #if self.tv.content_offset != MyView.last_content_offset : #print ('*',self.tv.content_offset, self.tv.content_size, #self.height) MyView.last_content_offset = self.tv.content_offset def feedback(self, st): self.tv.text += st +'\n' def textfield_did_change(self, textfield): self.value = textfield.text def textfield_should_return(self, textfield): st = textfield.text self.tv.text += '>'+ st + '\n' theModel.parse(st) textfield.text='' return True def delayed_close(self) : self.feedback('shutting down...') ui.delay(self.close, 5) def feedback(st): global theView theView.feedback(st) def startView(): global theView theView = MyView(frame = (0,0,430,300), bg_color='white') theView.present(style='sheet', animated=False) return theView class Model() : def parse(self,st) : print('after calling NewLink:',NewLink(st)) @ui.in_background def NewLink(st): fields = [{'title':'name','type':'text','value':st} ] result = dialogs.form_dialog(title='Link design', done_button_title='ok',fields=fields, sections=None) feedback(str(result)) print('from parse after dialog:',result) if __name__ == "__main__": console.clear() #show just ui theModel= Model() startView()
-
@Tel Try this 😂, it seems to work
#@ui.in_background def NewLink(st):
-
@cvp nope, it hangs for me.
-
@Tel WoW, it runs ok for me
-
sorry for this obvious question, but you are sure you tap on ok?
-
@cvp yes. I am going to shut this topic down. No one will read a topic with 50 posts
-
@Tel Ok, but a topic is not specially for other people than the guy who created it.
I was still trying to find a solution but your script is ok for me with or without the @ui.in_background.
It prints the "after dialog" only when I press the ok.