MMCC's PL/B notes
    Notes home
    Article index

Mid-Michigan Computer Consultants, Inc.
509 Center
Bay City, Michigan

Sales (989) 892-9242             Support (989) 686-8860

ANSI Standard PL/B Language
WINDOW Object Notes
This web resource is written for our own use. But we feel strongly that the PL/B language should be shared with the software community. So feel free to use this at will! BUT PLEASE... if you find errors or omissions or have a better way to do something. TELL US! Dialog helps us all. Send e-mail to:

(Also see Window Split Screen page.)

The WINDOW object is the base on which everything else is built. Most of the things dealing with windows is relatively straight forward. Here are some things we do in a standard fashion.

Sometimes we just want a window to get out of the way. Perhaps we've put up another window on top and want the first layer to be inactive. Here are some ways we do that.

    You can set the window visibility property to 0 and that will hide the window for sure. The problem is that a window is a collection. When you set the window to invisible, all objects on the window are also set invisible. When you later bring it back, everything comes back.

    Where that gets you is in cases where you are selectively setting visibility for various objects on the window. Perhaps you have a number of buttons and you turn them on and off depending on what the user is doing.

    If this is not a problem then the visibility thing works well.


    If you want the window to still be visible but not active you can do a DISABLEITEM to the window itself. Same problem here as with visibility. When you ENABLEITEM to get it back, ALL of the visible objects will be enabled. You might have to reset some individual objects.


    A really NICE technique is to use the "SHOW" method for a Window. This can make the whole thing just disappear and later bring it back with no change to any properties.

    There are a number of variations to the SHOW method. The two that we use the most are:
    • {windowname}.SHOW USING *MODE=$SW_HIDE
    • {windowname}.SHOW USING *MODE=$SW_SHOW
    • etc. see PLBMETH.INC
    The $SW values are defined in the PLBMETH.INC module provided by Sunbelt.

    There was a problem at one point getting to the main window. That's the window you see when you do a WINSHOW. It's where KEYIN/DISPLAY instructions work.

    In 8.6 a new object called MAINWINDOW was defined to gives access to the methods and properties for the default window. We've not tried this since most of the time we're working with the window object of the PLFORM. An example of MAINWINDOW from the Sunbelt web board is:
    wndMainWindow MAINWINDOW
                  wndMainWindow.Show USING *Mode=$SW_SHOWMAXIMIZED
    There is also an old setmode that people once used:
    From the PLB on-line reference:
    • The ON mode enables the full screen mode, allowing a program window to cover the full screen when an operator selects the window maximize control. The current background color specified with *BGCOLOR is used when the screen is expanded. The *FULLSCR control does not change the current window size. This is the default mode.
    • The OFF mode disables the maximize control.
    • The MAX mode maximizes the window under program control. The operator cannot shrink the window.
    • The MIN mode returns the window to the default size under program control.
    • The ABSOFF mode disables the maximize box button for the main window. Executing any of the other FULLSCR modes enables the maximize box button.


Send e-mail to MMCC.

Write to MMCC Technical Support at:
MMCC, Inc.
600 W. Midland
Bay City, MI 48708
(989) 686-8860
| Home   |

© 2003 MMCC, Inc. All Rights Reserved.

Report problems or suggestions to
Started 06/20/2003