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.


    ui.CheckBox?

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

      Is there an easy way to implement a ui checkbox control? I didn't find one on the ui doc class list. I was surprised.

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

        My best guess is a button that changes its image in the action. Are the empty box and checked box icons in the builtin images? Is there a list of the built ons somewhere?

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

          http://omz-software.com/pythonista/docs/ios/ui.html#switch ?

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

            Thank you. I saw that. It is functionally what I need but I don't like the icon. Nothing is being switched. I need more like a selection operation. I should probably skip the button altogether and use the TableView.enable_multiple_selection property instead. I assume that will highlight a row.

            At the high level I am mostly trying to implement a custom ListDataSource behavior with dated items where the items have multiple fields. I first tried packing all the data (including the date) into a single text string but I can't get a column like feel out of that interface. It looks better giving different fields their own fonts and I need control of where each field is displayed. So I am off in custom TableViewCell land.

            Thanks again.

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

              here is a simple CheckBox class.
              It is a wrapper for a ui.Button, but with auto toggling X, and internal value property like a a Switch. action, enabled work as in Switch

              You can customize the style by changing the display character, corner_radius, bg_color, etc. I didn't implement font yet, but you can acces the internal button _cb if needed.

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