• rb

    Ok it was the path again but it makes no sense to me …
    My path was resolved ok in designer using your script but I had to specify a full path to get it working as a load view. I don’t have to do this with the image views they work after I’ve set my file using
    os.chdir(os.path.split(__file__)[0])
    Anyhow it works so thanks again!

    posted in Pythonista read more
  • rb

    Found couple of issues.
    I had to add the middle line/check:

    if node['class'] in ['ImageView', 'Button']:
                  if 'custom_attributes' in node['attributes']:
                      attrs = node['attributes']['custom_attributes'] ```
    
    As I have some other buttons without anything in custom_attributes and it was erroring.
    After changing that I get the images appearing on buttons in designer woop! but unfortunately it still fails when imported as a load_view in my main function with same error ie :
    
    Warning: Could not load custom attributes of view "test_btn": 'NoneType' object has no attribute 'with_rendering_mode'

    posted in Pythonista read more
  • rb

    Dude your so generous with your assistance always above and beyond Thankyou ! It’s sunny right now in uk so I’m chillin with my dawg in the garden with a beer - will check this as darkness falls :)

    posted in Pythonista read more
  • rb

    Next question..
    If I want to add a custom image in designer for a button not an imageView…
    I can’t get the image to load using the same above syntax in custom attributes.Is this something to do with :
    .with_rendering_mode(ui.RENDERING_MODE_ORIGINAL)
    And if so what would the proper syntax be inside that custom attribute string? So far I just get errors if I add that as an extra string on end of image path.
    Also it’s not important that this image is visible in designer just that it works in final use when loaded/used in another view.

    posted in Pythonista read more
  • rb

    Nana is a beauty :)
    You are totally correct of course ! I managed to have 2 copies of the setImageInDesigner.py …duh one in iPad and one in iCloud where my scripts are stored so the path wasn’t resolving.Apologies for wasting part of your day with that !

    posted in Pythonista read more
  • rb

    @cvp no blanks no typos the test:Lenna works but not other images.Cant see a reason for it to not work. If I access an image in a dir the syntax would be :
    {'image': ui.Image.named('testDir/test.jpg')}
    Right?
    At least that’s what I was doing yesterday and it worked…I’m confused.

    posted in Pythonista read more
  • rb

    @cvp so no longer working for you either?
    Weird!?

    posted in Pythonista read more
  • rb

    Also I can longer get either method to work today on a pyui that was working fine yesterday..or any other pyui - any ideas why that would happen?

    I put a print statement in to check if it was finding the image name and it seems to be- it’s just not showing the image any longer.

    posted in Pythonista read more
  • rb

    @cvp not sure I understand..

    I just want to lock a selected imageView in the ui at its current position I think so that it will no longer move unless using the properties window.

    posted in Pythonista read more
  • rb

    Sorry yes - I’m loading an imageView as a sub view of the .pyui main ui.view and I’m basically using it as a bg image to help me position some other elements that I incorporate into another project later ie the easiest way to accurately place elements on an image is using the designer.I’m just saying that if the imageView that I use as a bg that fills entire canvas ,isn’t locked somehow in the designer ui ,it is very easy to accidentally select it and move it.

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!