• @Enez-Houad πŸ‘

  • @Enez-Houad If you want to make your TableView more nice, you can even put an image as background.
    Assuming tbl is your ui.TableView:

    ObjCInstance(tbl).setBackgroundView_(ObjCInstance(ui.ImageView(image = ui.Image.named('test:Peppers'), content_mode=ui.CONTENT_SCALE_ASPECT_FILL)))

  • Thanks for your answers, my problem is to find in English and in Pythonista what to search on the forum and that's sometimes difficult. Fortunately, there's alwais someone who is patient enough to explain ;-)
    A simple @ui.in_background was the solution…

    import ui class WaitClass(ui.View): def __init__(self): waitView = ui.View(name='waitView', frame=(0, 0, 240, 120)) l = ui.Label(name='label', frame=(0, 0, 240, 40)) l.center = waitView.center l.alignment = ui.ALIGN_CENTER waitView.add_subview(l) self.add_subview(waitView) def present(self): self.subviews[0].present('sheet', hide_title_bar=True, hide_close_button=True) def close(self): self.subviews[0].close() def message(self, msg): self.subviews[0]['label'].text = str(msg) def count(self): n = 100 for i in range(n): self.message(f'{i}/{n}') # β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” @ui.in_background def wait(sender): v = WaitClass() v.present() v.count() v.close() if __name__=='__main__': vp = ui.View(name = 'Vue principale', frame=(0, 0, 512, 384), background_color='white') b = ui.Button(frame=(10, 10, 60, 30), title='Pressez ici.', action = wait) b.center = vp.center vp.add_subview(b) vp.present('sheet')```
  • Shortcuts’ Open X-Callback URL allows for setting custom callback keys. By setting Success Key to argv the success is appended to the call to Pythonista as the last argument. Unfortunately only one of the keys can be set to argv as only the last one will be appended.

    Here’s an example:

    from datetime import datetime import json from urllib.parse import quote_plus .... x_success = sys.argv[-1] # shortcuts-production://x-callback-url/ic-success/<UUID> x_cancel = x_success.replace('ic-success', 'ic-cancel') x_error = x_success.replace('ic-success', 'ic-error') x_success += '?x-source=Pythonista3' x_success += '&result=' + quote_plus({....}) x_success += '&datetime=' + quote_plus(str(datetime.today())) webbrowser.open(x_success)

    Hope this is helpful to someone.

    Cheers,

  • @Enez-Houad before the present() yes, not after (I think)

    import ui v = ui.View() v.frame = (0,0,600,100) v.present('sheet')
Internal error.

Oops! Looks like something went wrong!