• tmessers

    I mean, how can i name it by using the function to create it?
    Where in the documentation can i find information about it?

    posted in Pythonista read more
  • tmessers

    Thanks for the answers.
    Yes, i want to read the TextFields.
    How can i name them?

    posted in Pythonista read more
  • tmessers

    Hello everybody, within my code i am creating ui.TextFields by a function. I need the input of that TextFields as values for further calculations. My question is, how i can refer to that TextFields?
    Below i‘m showing my code with the GUI part.

    import ui
    
    def button_tapped(sender):
        if sender.title == "Umrechnen":
            lon = tf1.text 
                    Lat = tf2.text
        elif sender.title == "Felder leeren":
            tf1.text = ""
            tf2.text = ""
    
    mg=20
    w=100
    h=30
    mg1=((2*mg)+w)
    mg2=((3*mg)+(2*w))
    
    
    def make_label(text,frame):
        return ui.Label(text=text, frame=frame, bordered=True, border_width=2)      
    
    def make_textfield(text,frame):
        return ui.TextField(text=text, frame=frame, bordered =True, clear_button_mode='always')
    
    def make_button(title, frame):
        return ui.Button(title=title, frame=frame, bordered=True, border_width=2,   action=button_tapped)
    
    
    v=ui.View(name='Koordinaten',bg_color='grey',tint_color='black',border_width=1)
    v.add_subview(make_label(text="Nordwert",frame=(mg1, mg, w,h)))
    v.add_subview(make_label(text="Ostwert",frame=(mg2, mg,w,h)))
    v.add_subview(make_label(text="Dezimalgrad",frame=(mg,((2*mg)+h),w,h)))
    v.add_subview(make_textfield(text='',frame=(mg1,((2*mg)+h),w,h))) #tf1
    v.add_subview(make_textfield(text='',frame=(mg2, ((2*mg)+h),w,h))) #tf2
    v.add_subview(make_button(title='Umrechnen',frame=(mg1,((6*mg)+(5*h)),w,h)))
    v.add_subview(make_button(title='Felder leeren',frame=(mg2,((6*mg)+(5*h)),w,h)))
    v.present() ```
    
    Can anybody help me?

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!