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.
Close view in Pythonista Keyboard
-
Hi,I want to click my "close" button to close the view in Pythonista Keyboard,but it’s not work.What's wrong with the following code?Thanks.
import ui import keyboard def close(sender): sender.superview.close() w, h = ui.get_screen_size() h = h - 64 view = ui.View(name = 'View', frame = (0,0,w,h)) bt1 = ui.Button(name = 'button1', frame =(10, 10, 80, 80), title='Close', action=close) view.add_subview(bt1) if keyboard.is_keyboard(): keyboard.set_view(view)
-
@mieq, I have not played with custom keyboards, but I suspect that
close
will not work, as the documentation states:”Close a view that was presented via View.present().”
Also, I do not fully understand what you would expect to see after the view is closed. The previously used keyboard? I do not think iOS keyboards stack like that (but have not researched the topic).
-
@mieq As @mikael asked, what do you want to do?
- close the view and fall in keyboards list? There is a close button at right (X)
- dismiss the keyboard? It is possible, I already did it in my Japanese Braille keyboard
-
You could use
keyboard.set_view(None)
-
@omz It works, but, honestly, not easy to find that 😀
-
@omz It works,Thank you!
-
@mikael Thanks for your reply, forget about my useless Demo code which is used for describing a problem.
-
@cvp Thanks for your reply, Forget about my useless demo code.Just want to select a table view row to insert from Pythonista Keyboard and close the view.
-
-
@omz You're right. I'll obviously never use it but your application is so vast that you will always meet someone who has requests that you have not thought of.
And that is a reason more why so much people here find your app (and you too) so marvelous, sincerely said, not to get a personal reduction 😂
-
This post is deleted!