omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular
    1. Home
    2. Bob Walance

    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 6
    • Best 0
    • Controversial 0
    • Groups 0

    Bob Walance

    @Bob Walance

    0
    Reputation
    539
    Profile views
    6
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    Bob Walance Unfollow Follow

    Latest posts made by Bob Walance

    • RE: Label text not displayed until end of Button action

      I really appreciate all of the tips. I'm a hardware engineer and am learning a lot about programming thanks to people like y'all.

      What I ended up doing was just to have the Button action routine set a semaphore that the main routine acts on. This works perfectly and is probably the right thing to do anyway so that main is not bogged down by delays in any of the background tasks.

      Bob

      posted in Pythonista
      Bob Walance
      Bob Walance
    • RE: Label text not displayed until end of Button action

      When I add the decorator in front of any button's 'def' then that button becomes inactive. I must be doing something wrong.

      Also, you used thread.sleep() in your code. I can't find any documentation on that.

      Thanks for your help on this.

      Bob

      posted in Pythonista
      Bob Walance
      Bob Walance
    • Label text not displayed until end of Button action

      With the UI Designer's help, I have a simple button and also a label (Record_label).

      In the button's Action code:

      ...
      view["Record_label"].text = "START" # write to the label
      time.sleep (2) # delay for a bit
      view["Record_label"].text = "END" # write to the label
      ...

      The problem that I'm having is that I only ever see the text "END" in the label.

      However, if I put in a line of code between "START" and "END" that causes an error, the script halts and then I do see the "START" text.

      So, I know that the "START" text is getting into the label, but the label's text field is only displaying the last modification (i.e., when the button's action terminates).

      Does anyone know what I can do to have the label's text field immediately show what has been written to it?

      Thanks much,
      Bob

      posted in Pythonista
      Bob Walance
      Bob Walance
    • RE: Trying to create a simple script with UI Designer

      Lukas,

      I got it. That works! Thanks.

      May you live to be one-thousand years old, sir.

      Bob

      posted in Pythonista
      Bob Walance
      Bob Walance
    • RE: Trying to create a simple script with UI Designer

      LK,

      That causes even more errors.

      If, just after:
      ui.load_view('My UI').present('sheet')
      I add:
      view = ui.load_view()

      I get this error:
      [Errno 2] No such file or directory...

      Bob

      posted in Pythonista
      Bob Walance
      Bob Walance
    • Trying to create a simple script with UI Designer

      Greetings,

      I'm brand new to Pythonista and I want to use UI Designer to create a form.

      Within UI Designer, I have added a LABEL box to the file 'My UI.pyui', and have changed the LABEL box's 'Name' attribute to 'Connect_label'.

      All I want to do is to change the LABEL box's TEXT attribute to "Fred", but I get an error:
      "name 'Connect_label' is not defined'

      I would have thought that by loading the "My UI" form (and that works) that I could have access to and modify the LABEL box's attributes. Do I need to add something else in the code?

      Here's the code:


      import ui
      ui.load_view('My UI').present('sheet')

      Connect_button.text = 'Fred'


      posted in Pythonista
      Bob Walance
      Bob Walance