OpenWindow()
Syntax
Result = OpenWindow(#Window, x, y, InnerWidth, InnerHeight, Title$ [, Flags [, ParentWindowID]])Description
Opens a new window according to the specified parameters. If #PB_Any is used as '#Window' parameter, the new window number will be returned as 'Result'.
The new window becomes the active window. It's not needed to use SetActiveWindow() to set it. If the 'Result' is 0, the window can't be opened.
'InnerWidth' and 'InnerHeight' specify the required client area (without borders and window decorations), for Windows XP, AmigaOS and Linux skinning compatibility. 'x' and 'y' specify the initial position of the window. (unless one of the center flags is used.) If one of them is #PB_Ignore, the OS will choose a position for the window.
'ParentWindowID' is an optional parameter which specify on which window the new window belongs to. 'ParentWindowID' value can be easily obtained with WindowID().
Possible flags are:#PB_Window_SystemMenu : Enables the system menu on the window title bar. #PB_Window_MinimizeGadget: Adds the minimize gadget to the window title bar. #PB_Window_SystemMenu is automatically added. #PB_Window_MaximizeGadget: Adds the maximize gadget to the window title bar. #PB_Window_SystemMenu is automatically added. #PB_Window_SizeGadget : Adds the sizeable feature to a window. #PB_Window_Invisible : Creates the window but don't display. Not supported on AmigaOS. #PB_Window_TitleBar : Creates a window with a titlebar. #PB_Window_BorderLess : Creates a window without any borders. #PB_Window_ScreenCentered: Centers the window in the middle of the screen. x,y parameters are ignored. #PB_Window_WindowCentered: Centers the window in the middle of the parent window ('ParentWindowID' must be specified). x,y parameters are ignored. #PB_Window_Maximize : Opens the window maximized. (Note: on Linux, not all Windowmanagers support this) #PB_Window_Minimize : Opens the window minimized.If the optional Flags parameter is not specified, #PB_Window_SystemMenu will be used.
All possible events in a window are handled with the WindowEvent() and WaitWindowEvent().commands. For special situations callbacks are used, see description at SetWindowCallback(). On Windows, the height and width of a window with a titlebar can't be less than around 100 pixels. To open smaller windows, use the "#PB_Window_BorderLess" flag.
Note: When opening a Window from a thread, the thread must also call WindowEvent() or WaitWindowEvent() in a loop to process events for this window, as window events are not sent between different threads.
Supported OS
All