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.
Changing size in UI Designer isn't reflected when running script
-
If I change the size of the Calculator example in the Inspector panel and then run the script, the Calculator is the same size as before the change, even though going back to the Inspector shows the changes have been preserved. How do I get the change to carry through to the running script? Thanks.
-
@Involute the .py sets the frame of the view, thus the size in the ui designer is not used.
if min(ui.get_screen_size()) >= 768: # iPad v.frame = (0, 0, 360, 400) v.present('sheet') else: # iPhone v.present(orientations=['portrait'])
-
Got it. Thanks.
Is there any way to hide the script while it's running other than to make the view fill the screen? It's a little annoying to see the script behind my UI, and scaling up the UI would scale all its elements, too, making them bigger than I want.
-
@Involute try
# iPad mv = ui.View() mv.background_color = 'white' mv.present() # full screen to hide the script code v.frame = (0, 0, 360, 400) v.present('sheet') v.wait_modal() mv.close()
-
Thanks. That gets the job done, though closing the main view doesn't close the background; I have to click on the X in the corner to do that. Not a big deal, but is there a way to close both when closing the main?
-
@Involute Sorry for the delay. As the calculator view is modal, you have to close it and the background view would be closed automatically. It works like that on my iPad. You are sure you did not forget my last line: mv.close() after the wait_modal.
-
@Involute or try this
# iPad mv = ui.View() mv.name = 'Calculator' mv.background_color = 'white' mv.present() # full screen to hide the script code w,h = ui.get_screen_size() v.frame = ((w-360)/2,(h-400)/2, 360, 400) mv.add_subview(v)