omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular
    1. Home
    2. KalyJupiter
    3. Best

    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.


    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 9
    • Best 2
    • Controversial 0
    • Groups 0

    Best posts made by KalyJupiter

    • RE: Presenting view and console

      I've actually, wonderfully, found what I was looking for, by accident, with the following setup:

      button.present('popover')
      button.action ⇒ view.present()
      view::button_item.action ⇒ view.alpha = 0 ⇒ clean, transparent view to the console log

      without the initial popover button, setting view.alpha = 0 results in a black, opaque screen.
      seems the popover enables something specific for transparency…

      here's a working example:

      import ui
      import time
      
      view = ui.View()
      view.frame = (0, 0, 240, 240)
      view.flex = 'WH'
      view.background_color = 'white'
      
      def alphaaction(sender):
      	print(view.alpha)
      	if view.alpha == 1.0:
      		view.alpha = 0.0
      		sender.tint_color = 'red'
      	else:
      		view.alpha = 1.0
      		sender.tint_color = 'black'
      
      alphabutton = ui.ButtonItem()
      alphabutton.action = alphaaction
      alphabutton.title = 'alpha'
      alphabutton.tint_color = 'black'
      view.right_button_items = [alphabutton]
      
      button = ui.Button()
      button.action = lambda x: view.present()
      button.frame = (0,0,40,40)
      button.background_color = '#9cd8a1'
      
      
      if False:
      	view.present() # => black screen
      else:
      	button.present('popover') # => transparent screen
      
      @ui.in_background
      def run():
      	k = 0
      	while True:
      		print("### test", k, "###")
      		k += 1
      		time.sleep(0.5)
      		
      run()
      
      posted in Pythonista
      KalyJupiter
      KalyJupiter
    • RE: Presenting view and console

      cheers, I found the beta signup form :)

      and I'm not worried about exiting the loop

      posted in Pythonista
      KalyJupiter
      KalyJupiter