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.


    [solved] built in icon to button?

    Pythonista
    3
    5
    3386
    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.
    • jmv38
      jmv38 last edited by jmv38

      i cant find how to use built in icons into ui buttons. Can anyone give me a link? (must be obvious, sorry).
      Thanks

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

        All you need is a ui.Image for the icons.

        # Say we have a button named "mybutton".
        
        import ui
        
        mybutton = ui.Button()
        mybutton.image = ui.Image("iob:document_32")
        mybutton.present()
        
        1 Reply Last reply Reply Quote 0
        • jmv38
          jmv38 last edited by jmv38

          thanks @AtomBombed
          i want to use arrow-resize icon from editor menu but this raise an error

          mybutton.image = ui.Image("iob:arrow-resize")
          mybutton.image = ui.Image("arrow-resize")
          

          what is wrong?
          And how do i get the list of built-in images?

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

            The icons for editor actions are not all available to use in scripts (for licensing reasons). You can get a list of available built-in images using the [+] button in the editor toolbar.

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

              thank you @omz
              so the answer to my question is (in case anyone needs it)

              mybutton.image = ui.Image("iob:arrow_resize_24")
              

              the [+] is quite tricky, it would be useful that when sby type 'icon' in the search filed of documentation, this information pops up (nothing pops up actually when i type 'icon').
              Thanks!

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