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.


    [Share Code] ProgressView

    Pythonista
    objcutil objc
    2
    2
    2669
    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.
    • blmacbeth
      blmacbeth last edited by blmacbeth

      (Here)[https://gist.github.com/60bacd65c89e5290f452] is a class I have been working on today, and have wanted for some time. It is a (mostly) complete implementation of the Objective-C UIProgressView class. Let me know what y'all think. I plan on eventually turning the UIImage and UIColor functions into their own modules in Python.

      B

      EDIT: To fix some weirdness when it comes to setting the progress back to 0.0 make sure you set animated to False.

      EDIT 2: I have added these two convenience methods to make things easier when working with progress views.

      def add_progress_view_top(to_view, name='progress_view'):
      	'''Adds a progress bar to top of a view under 'progress_view' '''
      	# Note: from my tinkering, I have found that the height is 2
      	progress_view = ProgressView()
      	progress_view.frame = (0, 0, to_view.width, 2)
      	progress_view.name = name
      	to_view.add_subview(progress_view)
      
      def add_progress_view_bottom(to_view, name='progress_view'):
      	'''Adds a progress bar to the bottom a view under 'progress_view' '''
      	# Note: from my tinkering, I have found that the height is 2
      	progress_view = ProgressView()
      	progress_view.frame = (0, to_view.height-2, to_view.width, 2)
      	progress_view.name = name
      	to_view.add_subview(progress_view)
      
      1 Reply Last reply Reply Quote 1
      • Webmaster4o
        Webmaster4o last edited by

        Wow. That's really neat. Good job!

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