Re: extra + character showing in gui textfield
Hi Grant, > Thanks Alex. Using a NumField does indeed fix it. Considering that I want to > display a message like "You cheated!" as well if the user clicks too many > times, > would I just use a different gui component then? Yes, then +TextField is fine. > I was trying a pretty naive wrapping of the repl interface to make the gui and > thought I could pack it all into one gui field. To get a dynamically changing display, you could instead of passing the numeric global '*Guess' to a '+NumField' (gui '(+Style +Var +NumField) "guess" '*Guess) use the '+View' prefix to produce arbitrary content: (gui '(+Style +View +TextField) "guess" '(cond ((cond1) "You cheated!" ) ((cond2) (pack "Guesses: " *Guess) ) ... ) ) Something like that? ☺/ A!ex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: extra + character showing in gui textfield
Thanks Alex. Using a NumField does indeed fix it. Considering that I want to display a message like "You cheated!" as well if the user clicks too many times, would I just use a different gui component then? I was trying a pretty naive wrapping of the repl interface to make the gui and thought I could pack it all into one gui field. Sent with ProtonMail Secure Email. ‐‐‐ Original Message ‐‐‐ On Thursday, August 29, 2019 12:27 AM, Alexander Burger wrote: > Hi Grant, > > > It works fine, except there is suddenly an extra "+" character after > > clicking > > a button for the second time. > > I think it is just a wrong class: > > > (gui '(+Style +Var +TextField) "guess" '*Guess) > > As the value of '*Guess' is a number, it needs '+NumField' instead of > '+TextField'. > > ☺/ A!ex > > > > > UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: extra + character showing in gui textfield
Hi Grant, > It works fine, except there is suddenly an extra "+" character after clicking > a button for the second time. I think it is just a wrong class: >(gui '(+Style +Var +TextField) "guess" '*Guess) As the value of '*Guess' is a number, it needs '+NumField' instead of '+TextField'. ☺/ A!ex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe