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.


    How do I Change color of top bar?

    Pythonista
    4
    6
    4129
    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.
    • MOD0
      MOD0 last edited by

      Hi, I’ve recently started pythonista for iOS.
      And I don't know how i change color of top bar.
      I don't know its bar name exact, so i decided to ask here.
      Please look at the image
      http://i.imgur.com/ru9o49j.png

      I mean I want to change color that space(bar?) , can i do that?

      or Please help me on how to full space when ran myself gui program.
      like this example game program. http://i.imgur.com/lNExnah.png

      Thank you for reading.

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

        @MOd0 you can pass title_bar_color to View.present().

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

          @bennr01 said:

          title_bar_color to View.present().

          Tkanks for tell that, I became capable of change default bar_color.
          i pleased.

          but, how can i change "title_bar_color" when running program like when change "background_color" ,(for example label,button,,,).

          for example i want change "title_bar_color" like that

          1. red (when start progrum)

          ↓

          1. blue ( when "button1 = sender.superview['button1']" pushed)

          ↓↑

          1. green ( when "button2 = sender.superview['button2']" pushed)
          1 Reply Last reply Reply Quote 0
          • lachlantula
            lachlantula last edited by

            This works decently.

            import time, ui
            
            class Interface():
            
            	@ui.in_background
            	def Switch(sender):
            		if Interface.bgcolour == 'red':
            			Interface.bgcolour = 'blue'
            			Interface.btn.title = 'Red!'
            		else:
            			Interface.bgcolour = 'red'
            			Interface.btn.title = 'Blue!'
            		Interface.v.close()
            		time.sleep(1)
            		Interface.v.background_color = Interface.bgcolour
            		Interface.v.present('sheet', title_bar_color = Interface.bgcolour)
            
            	btn = ui.Button()
            	btn.title = 'Blue!'
            	btn.x = 0
            	btn.y = 0
            	btn.width = 300
            	btn.height = 300
            	btn.action = Switch
            
            	bgcolour = 'red'
            	v = ui.View(background_color = bgcolour)
            	v.add_subview(btn)
            	v.width = 300
            	v.height = 300
            	
            x = Interface()
            x.v.present('sheet', title_bar_color = 'red')
            
            1 Reply Last reply Reply Quote 0
            • JonB
              JonB last edited by

              You need to resort to objective c to do this....

              https://gist.github.com/a74e256d3972192f3d70b9bc1bcbe1bc

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

                @lachlantula
                Thanks for tell me that add subview with changing bar_color.
                I learned python grammar which i didn't know until now.

                @JonB
                Thanks for tell me the :URL.
                I achieve my objective that changing bar_color when running program without change or add subview.

                for everyone who answered my asking
                Thank you for answering my question, and
                I thank you for reading it through.
                By now, I guess you get used to my funny English writing.

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