• momorprods

    Oh thanks for mentioning the ui.inbackground() stuff - that was the issue !

    Actually my code was reloading all the images from a @ui.inbackground section, which is bad design.

    Fixed it in order to ensure all is always loaded from the main thread, it works great now !

    Sorry for bothering, and thanks for the super fast reply.

    posted in Pythonista read more
  • momorprods

    Greetings,

    Long time no see, I've been playing around with the new Pythonista 3 and my old projects.

    One of them - basicaly an UI app which allows for upload of a few images from the camera roll and renders them into a UISceneView, litteraly makes Pythonista crash when my app gets the control back from the photo picker. At this part of the code, my app mostly unloads all previous images and reloads them. The crash happens randomly : most of the time it happens on the first try, sometimes it happens after 2,3 attempts.

    Ironicaly, this app was running perfectly on the older Pythonista. When I launch it as a standalone scene and make multiple load/unloads of the same images, everything is fine too.

    My initial guess is the UI module eats up a lot more memory than the previous version. I've tried to put a few gc.collect() in the code, with no luck.

    The code is quite big and refers to a few external files, so it's hard to share it there. But I'd really appreciate some insights on a strategy to help me fixing this - as I loose the console output upon each crash :-(

    Thanks !

    posted in Pythonista read more
  • momorprods

    Hmm I confirm I still have the issue, even from a brand new test program.

    Did you test it also with subviews ?

    Perhaps it's only iPhone related ?

    posted in Pythonista read more
  • momorprods

    I noticed a small issue with UI in build 160032: button images are not displayed, even after a new selection in the editor.

    Also: while the image picker shows correctly for buttons in the main view, it does not display any image for buttons located in sub-views.

    Just to mention : UI imported from the 1.5 release display the button images in 1.6, until you try to change them.

    posted in Pythonista read more
  • momorprods

    Well, I ended up using a lot of Flex, and making a custom view just to set the main UI frame & bound according to the device screen size (ui.get_screen_size()) as you suggested.

    This works great, and even updating the UI pixel size in the UI editor reflects in realtime the full flex updates.

    Perhaps an option to set the global UI size into something proportional to the device screen size (instead of defining an actual pixel size) would feel more natural, but honestly I'm fine with this solution so far.

    Thanks for your help !

    posted in Pythonista read more
  • momorprods

    Hmm thanks guys, I'll give this a try. Flex might be the solution in my case, but I need to deep a bit more about it.

    posted in Pythonista read more
  • momorprods

    Hey guys,

    So I'm now converting my projects to the 1.6 beta, which works great for my needs (thanks again @omz for the SceneView fix).

    My plan is, at some point, to build my app for the App Store, so I need my UI to take into account the various screen sizes from an iPhone 4 up to an iPhone 6 plus (not even talking about the iPad). I don't want to center a smallest UI on the screen, I need it to switch fullscreen for all the devices.

    As a matter of design, using the UI system, what would be the smartest way to perform this ?

    I'm currently considering manually resizing and repositionning all my UI items at the application start, but perhaps there's a better way to do it ?

    Any advice welcomed !

    posted in Pythonista read more
  • momorprods

    Thanks for the fix, build 160032 works perfectly !

    posted in Pythonista read more
  • momorprods

    Thanks for your reply, keep up the good work !

    posted in Pythonista read more
  • momorprods

    Greetings,

    I have a critical issue with the SceneView on the newest beta. Here is a test script, it crashes Pythonista upon running. Is there something I'm missing ?

    # coding: utf-8
    import ui
    from scene import *
    import console
    
    class TestScene (Scene):
        def draw(self):
            # display hint --------
            tint(1,1,1)
            background(1, 1, 1)
            
            fill(1, 0, 0)
            for touch in self.touches.values():
                ellipse(touch.location.x - 25, touch.location.y-25,50,50)
        
    class TestView (ui.View):
        def __init__(self, width=1024, height=1024):
            self.bg_color = 'white'
    
    w, h = ui.get_screen_size()
    canvas_size = max(w, h)
    
    sv = TestView(canvas_size, canvas_size)
    sv.name = 'Test'
    sv.present('fullscreen')
    
    adv2 = SceneView()
    adv2.scene = TestScene()
    adv2.paused=False 
    adv2.bounds = sv.bounds
    

    Thanks for any help on this issue.

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!