Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FreshWin (c) Fresh Technologies - <b>viewupdate() event function</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  VIEWUPDATE()                                                Event Function
 Purpose..: Update a view window to display text
-------------------------------------------------------------------------------
 Syntax...: viewUpdate( <aMsg>, <aLook> ) --> lEscapePressed

 Arguments: <aMsg>    = array as defined for the return value of
                        GetEvent(). See the example or the description
                        of GetEvent() for further details.

            <aLook>   = array returned by viewNew() which
                        contains all the elements to create and
                        display text in a view window.

 Returns..: lEscapePressed is TRUE if you pressed the Escape key or
            the key is stuffed into the keyboard buffer as a result
            of trying to use the function with a window that is not
            configured properly.

 Remark...: It is recommended (in the strongest terms) that you
            use windows with a WS_CUA style with the function.

            The function is an example of an event-driven routine.
            viewUpdate() sits and waits for you to do something. If you
            provide input from the keyboard or the mouse, it verifies
            that it can do something with the event or it just sits
            there. Sorta reminds me of a dog I knew when I was young.

 Source...: WVIEW.PRG
-------------------------------------------------------------------------------
 Example..: . The example stashes the returned array of
              viewNew() in the cargo slot of a window for
              future viewing. A loop is set up to process the READ.ME
              file. Until the Escape key is pressed, you can input
              an event via the keyboard or a mouse. The function will
              process it, if recognized. Otherwise it waits for the next
              event.

        if isFile( "READ.ME" )
          wOpen( "ShoRead" )
          wCargoPut( "ShoRead", "V_DATA", viewNew( "ShoRead", "READ.ME" ) )
        endif
        ...
        while viewUpdate( getEvent(), wCargoGet( "ShoRead", "V_DATA" ) )
        enddo

 Note.....: You can check this out by looking at the viewUpdate()
            code, but here's how it performs. Using GetEvent() as a
            parameter and knowing that wCargoGet() returns whatever is
            stored there (an array in the example), the keyboard/mouse
            event is processed to check whether the window is active,
            then whether the event is related to a window size change
            or movement. If not, then a decision is made whether the
            event is from the keyboard or the mouse. Finally, the event
            is interrogated as to what it is. For such events as an up
            or down arrow, PgUp or PgDn, Home or a left or right mouse
            click, the event function, viewUpdate(), processes it. If
            the event is not recognized, it waits for one that the
            function does know.

See Also: wView() viewNew() viewClose() viewStabilize() GetEvent()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson