• Brian

    From what I understand, a delegate is a function that gets called whenever it's action occurs. I have my function, but it's not being called. Here's what I have:

    class myclass():
    ig=ui.load_view('myview')
    tv=ig['textview1']
    
    def textview_did_change(self, textview):
        print'hi'
    

    How would I properly implement my delegate?

    posted in Pythonista read more
  • Brian

    When I append text to the text box, the delegate is not called even when I have it properly configured. Is this intentional or is it a bug? Also thanks for the help, much was learned.

    posted in Pythonista read more
  • Brian

    @ShadowSlayer
    Could you provide an example of how to do this while using ui.load_view()?
    I can't seem to get it working.

    posted in Pythonista read more
  • Brian

    You guys are the best! That's exactly what I was looking for, thanks for the help.

    posted in Pythonista read more
  • Brian

    How would I use the ui module (preferably using the built in visual ui editor) to create a ui that has a constantly updating text box? I want to be able to constantly feed my user information as they progress through my text-based-game. (This means I don't want the user to be able to edit the text I show them.)

    posted in Pythonista read more
  • Brian

    What I am trying to do is create a ui with a single button. Upon the first button press a timer starts, which after 5 seconds closes the view. I want to measure the number of times the user can tap the button in 5 seconds. I display my ui (which I made in the visual ui editor) using the ui.load_view()
    But where I am fuzzy is when I have to close the view, and how to use the timer objects.
    I'm also programming in an object oriented style if that matters. I need the button I am trying to create to be reusable. Can anyone shed light on how I could tackle this problem?

    posted in Pythonista read more
  • Brian

    Thanks for the response!
    How would I go about calling view? Do I need to set up an instance of the ui.View class, and then call it using that? I've been fiddling with it for a while now and cannot seem to get the view to close. The official documentation is a bit vague for a beginner like myself, so it's a possibility something from there went over my head.

    Here's what I have:

    v=ui.View()
    
    
    def button_tapped(sender):
            if b.taps<1:
                ui.delay(b.cw,1)
            b.taps+=1
    class battleui:
        taps=0
        ui.load_view("Brian's Adventures ab").present('sheet') 
        def cw(self):
            v.close()   
            b.taps=0

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!