• @mikael I started from the Pythonista doc about scene shader and then I used Google to find help about GLSL language and examples.

    And my little GLSL program has only 4 lines, that's not too much 🤕

  • @cvp @mikael possibly documented because Developer may not of done extensive testing with larger numbers of lines? or even testing difernt text wraping? just to cover the posibility of bugs between releases..?

  • I had discovered that if you search in your scripts a text containing long Unicode characters, the range of the selected text was erroneously computed. @jonB did find a corrected way to extract the selected text and thus, his customMenuItem.py module should be corrected. You will find my own version here new customMenuItem.py

  • @cvp. Helpful! Thank you.

  • @Olaf Thanks a lot, I didn't know this \1

  • Merci beaucoup !

  • @mikael i know its been a few but the subject was left open with the a workaround that didnt really fiit the needs of @Samer at this post. would safeAreaLayoutGuide() and Anchors being used here fix the the problem with safe area we had?

  • More visible without title and a transparent background...

  • @tomkirn yes, how did you find that? I too was going by the docs, happening across this tonight “fullscreen” fixes it. Thanks.

  • @mikael Ok, Thanks for the check. It is not so important as I can check each 0.1 second if the content_size width has changed. On my iPad mini 4, it takes 0.1 second for a chapter of 5 pages but 2 seconds for a chapter of 30 pages..
    This automatic multi-columns functionality is really nice to have book-like pages

    I think iBooks app performs something like that because if you change the font size, it takes some time before to show the total number of pages...

  • @mikael said:

    this being an 13.1 bug on iPad.

    Still there in 13.1.3

  • We can do the transform inside the def via ObjectiveC

    from objc_util import * import ui def GetUIImageOfPDFPage(path,pageid=1): UIGraphicsGetCurrentContext = c.UIGraphicsGetCurrentContext UIGraphicsGetCurrentContext.restype = c_void_p UIGraphicsGetCurrentContext.argtypes = [] CGPDFDocumentCreateWithURL = c.CGPDFDocumentCreateWithURL CGPDFDocumentCreateWithURL.restype = c_void_p CGPDFDocumentCreateWithURL.argtypes = [c_void_p] CGPDFDocumentGetNumberOfPages = c.CGPDFDocumentGetNumberOfPages CGPDFDocumentGetNumberOfPages.restype = c_void_p CGPDFDocumentGetNumberOfPages.argtypes = [c_void_p] CGPDFDocumentGetPage = c.CGPDFDocumentGetPage CGPDFDocumentGetPage.restype = c_void_p CGPDFDocumentGetPage.argtypes = [c_void_p, c_void_p] CGPDFPageGetBoxRect= c.CGPDFPageGetBoxRect CGPDFPageGetBoxRect.restype = CGRect CGPDFPageGetBoxRect.argtypes = [c_void_p,c_void_p] CGContextDrawPDFPage = c.CGContextDrawPDFPage CGContextDrawPDFPage.restype = None CGContextDrawPDFPage.argtypes = [c_void_p,c_void_p] CGContextScaleCTM = c.CGContextScaleCTM CGContextScaleCTM.restype = None CGContextScaleCTM.argtypes = [c_void_p, CGFloat, CGFloat] CGContextTranslateCTM = c.CGContextTranslateCTM CGContextTranslateCTM.restype = None CGContextTranslateCTM.argtypes = [c_void_p, CGFloat, CGFloat] ns_url = nsurl(path) document = CGPDFDocumentCreateWithURL(ObjCInstance(ns_url)) #np = CGPDFDocumentGetNumberOfPages(document) #print('CGPDFDocumentGetNumberOfPages=',np) # to check if document is ok page = CGPDFDocumentGetPage(document,pageid) kCGPDFMediaBox = 0 page_mediabox = CGPDFPageGetBoxRect(page,kCGPDFMediaBox) w = page_mediabox.size.width h = page_mediabox.size.height #print('mediabox=',w,h) # to check if mediabox is ok with ui.ImageContext(w,h) as context: cn = UIGraphicsGetCurrentContext() CGContextTranslateCTM(cn,0.0,h) CGContextScaleCTM(cn, 1.0, -1.0) CGContextDrawPDFPage(cn,page) return ui_image # Protect against import if __name__ == '__main__': full_path = '/private/var/mobile/Library/Mobile Documents/iCloud~com~omz-software~Pythonista3/Documents/Mes Livres/Les Blondes - La compil des vacances.pdf' ui_image = GetUIImageOfPDFPage(full_path,pageid=40) v = ui.ImageView() v.image = ui_image #v.transform = ui.Transform.scale(1,-1) # CGContext is up/down inverted v.present(hide_title_bar=True)
  • One more time, thanks to @dgelessus for his quick and useful help

    See here

  • @mikael You're right. I'm just busy to modify my script so, if my little PY2 script does not yet exist on the iPad, the PY3 script will download it from the iMac before launching it.
    Complex, isn't it? 🤔

  • New version V0.1 of OneArmBanditGame.py

    # Version V0.1 # - bug: view title was "diring" instead of "during" # - mod:random selection, # instead of showing (selecting) row between 1th and n-th, # show (select) row between n + 1 and n + n to avoid blank rows at top # - mod: disable manual spin # - mod: inverse rotation sense, like real one-arm bandit games # - mod: always turn in same sense # - mod: reuse identic view per component
  • @omz, @ccc, any idea whether the forum software would support such a challenge/”secondary password” to get a posting access?

    On Pythonista end we would need nothing new. E.g. challenge is ”ui.Tableview”, response is the result of:

    hash(''.join(dir(objc_util.ObjCInstance(ui.TableView()))))

    ... that is, something that an average forum spambot certainly cannot perform.

  • @cvp, mesmerizing!

Internal error.

Oops! Looks like something went wrong!