| **Navigation:**  [[abc library reference.htm|ABC Library Reference]] > WindowManager > WindowManager Methods >====== Open (open and initialize a window structure){{c6h0009.jpg|C6H0009.jpg}} ====== | [[kill shut down the windowmanager object .htm|{{btn_prev_n.gif|Previous page}}]][[abc library reference.htm|{{btn_home_n.gif|Return to chapter overview}}]][[postcompleted initiates final window processing .htm|{{btn_next_n.gif|Next page}}]] | | || **Open, VIRTUAL** **Open **(** **//mainwindow, <;ownerwindow>// ), **VIRTUAL** {{blk2blue.jpg|blk2blue.jpg}} | //mainwindow// | The label of the window that needs to be opened. | | //ownerwindow// | The label of the owner window, if applicable. This is the label of the APPLICATION or WINDOW structure which "owns" the //mainwindow// being opened//.// | The **Open **method, when called with the //mainwindow// and optional //ownerwindow// parameters, is used to open a window for processing. A //mainwindow// with an //ownerwindow// always appears on top, and is automatically hidden if the //ownerwindow// is minimized or hidden. If the //ownerwindow// is closed, all owned windows are also automatically closed. The **Open **method when called without parameters, prepares the window for display. It is designed to execute on window opening events such as EVENT:OpenWindow and EVENT:GainFocus, and can optionally translate a window if necessary. **Implementation:** The Open method invokes the Translator if present and calls the Reset method to reset the WINDOW. The TakeWindowEvent method calls the Open method. **Example:** **ThisWindow.TakeWindowEvent  PROCEDURE** **  CODE** **  CASE EVENT()** **    OF EVENT:OpenWindow** **      IF ~BAND(SELF.Inited,1)** **        SELF.Open(Window)** **      END** **    OF EVENT:GainFocus** **      IF BAND(SELF.Inited,1)** **        SELF.Reset** **      ELSE** **        SELF.Open** **      END** **  END** **  RETURN Level:Benign** **ThisWindow.Open  PROCEDURE** **  CODE** **    IF ~SELF.Translator&=NULL** **      SELF.Translator.TranslateWindow** **    END** **    SELF.Reset** **    SELF.Inited = BOR(SELF.Inited,1)** **!Usage with parameter(s):** ** SELF.Open(Window)** **See Also:**     [[reset reset the window for display .htm|Reset]], [[takewindowevent a virtual to process non field events windowmanager .htm|TakeWindowEvent]] , [[translatewindow translate text for a window .htm|TranslateWindow]] [[open open a data structure .htm|OPEN]]