Topic: settextboxcontents/gettextboxcontents sequence

Why is the following not getting me user text input?

       integer i1, ii1
       character*5 sa_text
       common /texts/ sa_text
       character*20 buffer
       common /buffer/ buffer

       sa_text = '0'
       call settextboxcontents (i1, sa_text)
       call settextboxentercallback (i1, get_buffer)
       ii1 = gettextboxcontents (i1, buffer)
       read (buffer, *) start_angle

The buffer value does not change no matter what the user enters. What am I doing wrong?

Re: settextboxcontents/gettextboxcontents sequence

If you're using the code above as-is, the program just executes straight through immediately.  There is no "wait" state in the code.

You'd actually want something like:

       integer i1, ii1
       character*5 sa_text
       common /texts/ sa_text
       character*20 buffer
       common /buffer/ buffer

       sa_text = '0'
       call settextboxcontents (i1, sa_text)
       call settextboxentercallback (i1, enter_pressed)
       call loop()
       ii1 = gettextboxcontents (i1, buffer)
       read (buffer, *) start_angle

and add a subroutine enter_pressed:

       subroutine enter_pressed
       use appgraphics, only: stopidle
       implicit none

           call stopidle()

       end subroutine enter_pressed

that will cause the main program to break out of the call to loop when the user presses enter in a text box.

Jeff Armstrong
Approximatrix, LLC