omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular
    1. Home
    2. daveM
    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 5
    • Posts 17
    • Best 2
    • Controversial 0
    • Groups 0

    Best posts made by daveM

    • RE: Unable to use location.reverse_geocode inside a scene/layer

      @cvp you beat me to it! Thanks very much I do appreciate that! Cheers!!

      (Damn, if someone could hit me some rep points I’d appreciate it!!! @cvp and I submitted a message about the same time, I can’t respond until the time passes... which is why I added this text to the bottom!!) lol

      posted in Pythonista
      daveM
      daveM
    • Unable to set label size in custom view

      I'm using boilerplate code from the docs (http://omz-software.com/pythonista/docs/ios/ui.html#building-custom-views) and added just a label to display touch location. No matter what I define as the initial points of three label, it is always a fixed size on the screen.

      No matter what settings I create the label, it is always defaulted to (0,0) and a small width. I do want it to be full width, the values shown here are for testing.

      import ui
      
      class MyView (ui.View):
      	def __init__(self):
      		
      		self.info=ui.Label(
      			self.height/2,
      			self.width/2,
      			self.width/2, 
      			self.height/4)
      		self.info.corner_radius=9
      		self.info.alignment=ui.ALIGN_CENTER
      		self.info.background_color='#6bff6b'
      		self.add_subview(self.info)
      		self.background_color='#fff9d6'
      
      	def draw(self):
      		w=self.width
      		h=self.height
      		l=w/4
      		t=h/4
      		w=w/2
      		h=h/2
      		path = ui.Path.rect(l,t,w,h)
      		ui.set_color('blue')
      		path.fill()
      		img = ui.Image.named('iob:alert_256')
      		img.draw(l,t,w,h) #self.width, self.height)
      
      	def touch_moved(self, touch):
      		x,y=touch.location
      		self.info.text = '{:04}-{:0=4}'.format(int(x),int(y))
      
      v = MyView()
      v.present('sheet')```
      posted in Pythonista
      daveM
      daveM