omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    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.


    Custom views in ui builder?

    Pythonista
    2
    3
    1683
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • JonB
      JonB last edited by

      Has anyone gotten a custom view which is not the main view to work in the ui builder? I'm running 1.5 on ios 7.

      There is a custom view widget, which lets you insert a custom view class... I've made sure to define the class before calling load_view, but the custom view object is never instantiated, instead only a vanilla _ui.View.

      If I set a custom view for the main view, and load_view, it does produce an object of the custom class... Just not for widgets added using the Custom View button.

      1 Reply Last reply Reply Quote 0
      • polymerchm
        polymerchm last edited by

        Check out my chordcalc script. The fretboard is a custom view. I create in in the builder.

        1 Reply Last reply Reply Quote 0
        • JonB
          JonB last edited by

          Ok, it appears that the custom class cannot be in another module.

          For instance, if try to specify myModule.someclass in ui builder, and have the following code

          import myModule
          import ui
          ui.load_view('myView')
          

          I get

          Warning: Custom class 'myModule.someclass' could not be found.
          

          But, if I import someclass directly, and just specify someclass In the builder

          from myModule import someclass
          import ui
          

          works ok.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Powered by NodeBB Forums | Contributors