omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular
    1. Home
    2. skrohmer

    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 8
    • Posts 21
    • Best 1
    • Controversial 0
    • Groups 0

    skrohmer

    @skrohmer

    Programming experience since the late 1990s: PLC programming and C++ for profession, a lot of Python for tools for daily work and - most important - for fun ;-)

    2
    Reputation
    950
    Profile views
    21
    Posts
    0
    Followers
    0
    Following
    Joined Last Online
    Website github.com/skrohmer/Pythonista Location Germany

    skrohmer Unfollow Follow

    Best posts made by skrohmer

    • RE: WebView navigation buttons

      OK, done. :-)

      quick&dirty (hopefully not very dirty ;-), but if you find some things to optimize please tell me):

      import ui
      
      class MyWebView(ui.View):
      	def __init__(self, url):
      		self.width, self.height = ui.get_window_size()
      		self.wv = ui.WebView(frame=self.bounds)
      		self.wv.load_url(url)
      		self.add_subview(self.wv)
      		bi_back = ui.ButtonItem(image=ui.Image.named('iob:ios7_arrow_back_32'))
      		bi_forward = ui.ButtonItem(image=ui.Image.named('iob:ios7_arrow_forward_32'))
      		bi_back.action = self.go_back
      		bi_forward.action = self.go_forward
      		self.right_button_items = [bi_forward, bi_back]
      		self.present()
      
      	def go_back(self, bi):
      		self.wv.go_back()
      	
      	def go_forward(self, bi):
      		self.wv.go_forward()
      
      
      wv = MyWebView('https://forum.omz-software.com')
      
      posted in Pythonista
      skrohmer
      skrohmer

    Latest posts made by skrohmer

    • RE: Pythonista access to iOS virtual MIDI port

      Hi guys,

      Are there any news regarding MIDI access?

      posted in Pythonista
      skrohmer
      skrohmer
    • CoreMIDI

      Hi friends of electronic music :-),

      I'm looking for a possibility to use Pythonista for communicating to MIDI devices. I have found one thread here (created about 2 years ago) discussing this a bit, but there is no solution mentioned. What's the current situation? Do I e.g. have a possibility to use objc_util to call the required functions? Did anyone already play around with this? Thanks!

      Stefan

      posted in Pythonista
      skrohmer
      skrohmer
    • RE: Image extension does not work anymore

      OK, things can be so easy ;-). I tried it with a PNG, and the example works only for JPEGs.

      posted in Pythonista
      skrohmer
      skrohmer
    • Image extension does not work anymore

      Hello,

      I have recently upgraded to a new iPad Air and also installed the new Pythonista version. Now the extension does not find images anymore. You can test this with the example "Copy Photo Location". When I send an image to this extension I get the position information of the image if I use the iPhone. When I do this on the iPad I get the message "No input image found". Either it is related to iPhone / iPad or to iOS 10.0.2 / 10.2. The iPad runs iOS 10.2. I think this is the problem. My last iPad with iOS 10.0.2 worked fine. Can anyone reproduce this behavior?

      Stefan

      posted in Pythonista
      skrohmer
      skrohmer
    • RE: Scene destructor

      Thanks, I will try this. I was so focused on the word 'destructor' that I missed them.

      posted in Pythonista
      skrohmer
      skrohmer
    • Scene destructor

      Hello Pythonista friends,

      Me again ;-) with a simple question which could not be answered by the documentation: Is there any kind of useable destructor for a Scene object? When terminating the program I would like to save some data which is created dynamically during the runtime and as I see for the moment the nicest solution would be a member function within my class (the class is derived from scene.Scene). Sometimes I have used __del__ in other classes but it does not seem to work in a stable way. Is there a function within Scene which is called when the scene is closed and all nodes are still available?

      Stefan

      posted in Pythonista
      skrohmer
      skrohmer
    • RE: Sharing extension with arguments does not start

      Yes, see above: print 'hello' ;-) You don't really need code, one line printing some text (or sys.argv) is enough. Go to Settings / Share Extension Shortcuts -> create a new shortcut -> set Arguments to any value. After that run the extension by sharing any file. That's it.

      posted in Pythonista
      skrohmer
      skrohmer
    • Sharing extension with arguments does not start

      Hi,

      Does anyone have an sharing extension running successfully which receives arguments at the call? I don't even get the simplest program running which only contains print 'hello'. When I leave the shortcut parameter "Arguments" blank the program runs. When I set the arguments to any string or number the program is not called.

      Stefan

      posted in Pythonista
      skrohmer
      skrohmer
    • RE: Exception when opening ui.View using popover style

      This seems to be the shortest solution for now:

      import ui
      from scene import *
      
      class MyScene(Scene):
      	def setup(self):
      		pass
      
      	def get_viewpos_from_touch(self, touch):
      		xt, yt = touch.location
      		xw, yw = ui.get_window_size()
      		return xt, yw - yt
      
      	def touch_began(self, touch):
      		menu = ui.View(frame=(0, 0, 200, 200))
      		menu.present('popover', popover_location=self.get_viewpos_from_touch(touch))
      
      
      run(MyScene())
      

      I can live with that at least at the moment. I hope that "hiding" the popup as I already explained does not result in memory leaks. ;-)

      However, I'm still interested in any information which explains the strange behavior mentioned above: Why does the popup not close completely?

      posted in Pythonista
      skrohmer
      skrohmer
    • RE: Exception when opening ui.View using popover style

      Yes, seems to be better. I will check again which is the best solution for me. I'm still struggling with this popup. Maybe someone else has a hint, too. Maybe @omz can tell us why the popup does not disappear completely when I click beside it.

      BTW: The position seems to be strange because the coordinate systems are different. The popup placed at position 0,0 appears in the top left corner, but the point 0,0 of the touch coordinates is in the bottom left corner. The Y axes are leading in different directions.

      posted in Pythonista
      skrohmer
      skrohmer