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>wsetcolor() window function</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  WSETCOLOR()                                                Window Function
 Purpose..: Set a window's default color
-------------------------------------------------------------------------------
 Syntax...: wSetColor( [<uWin> [, <cClr> [, <nArea>]]] ) --> cSavClr

 Arguments: [<uWin>] = the string identifier of the window
                       OR the reference to the window structure
                       returned as an array by wNew() or wArray().
                       If not passed, the function will operate on
                       the window in focus.

            [<cClr>] = new window color string.

            [<nArea>]= area of the window in which to set the color.

            Area Manifest Constants as found in FW_MAIN.CH
            -------------------------------------------------------------
            Value   FW_MAIN.CH   Description
            -------------------------------------------------------------
            0       WC_NONE      It will return the default setting.
            1       WC_TEXT      The default area. It will affect all
                                 wSay() operations.
            2       WC_FRAME     It will set the default color for the
                                 window frame.
            3       WC_TITLE     It will set the default color for the
                                 window title.
            4       WC_ALL       It will set the default color for all
                                 the window areas.
            -------------------------------------------------------------

 Returns..: <C> The previous defined color.

 Remark...: Sets a window's color permanently, returning the
            previous defined window color.

            The function works whether the window is open or not.

 Source...: WCHGCLR.PRG
-------------------------------------------------------------------------------
 Example..: . The example will set the window frame color on
              a closed window to bright white on red.

            wClose( "MyWin" )
            cSavClr := wSetColor( "MyWin", "W+/R", WC_FRAME )

            wOpen( "MyWin" )    // Displays window frame in new color.
            wClose()
            wSetColor( "MyWin", cSavClr, WC_FRAME )

            wOpen( "MyWin" )    // Displays window frame in original color.


            . The example set the wSay() color of the window "MyWin".

            wSetColor( "MyWin", "GR+/R" )
            wOpen( "MyWin" )

            wSay( ,,, "This is Yellow on Red" )

See Also: wSetAttr() RevAttr() ClrTable() SetAttr()

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