SelectDisplay -- select a display as output device (V4.5)
SelectDisplay(id[, noactivate])
This function makes the display specified by id the current display. The current display is the display that all commands of Hollywood's graphics library draw to. Furthermore, several other functions refer to the current display; for example, WaitLeftMouse() will wait for the left mouse button to be clicked in the currently active display, and SetPointer() will change the mouse pointer of the currently active display.

The optional argument noactivate specifies whether or not the display shall also be activated. This argument defaults to False which means that by default, the specified display is made the current display and it is also activated. Make sure you understand the difference between the current display and the active display: The current display is not necessarily the active display and vice versa. The active display has nothing to do with Hollywood itself. It just means that the window manager of the host OS will highlight the display and make it the active one. Active windows will also get the keyboard focus and on some operating systems active windows are always put to the front. The current display on the other hand is the display that Hollywood commands use to draw their graphics to. Thus, you could also turn an inactive display into the current display. Hence, you should keep in mind that this function makes the specified display the current display. Optionally, it activates the display, too. If you only want to activate a display without making it the current one, ActivateDisplay() is the proper function for you.

Also note that Hollywood always requires a current display. It is not possible to create a Hollywood script that runs without a current display. You can, however, create the illusion of a Hollywood script without a current display. By using CloseDisplay() you can close all displays (or use the Hidden tag in @DISPLAY). It will then seem as if there was no current display but that is a wrong assumption. There is still a current display; it is just not visible. Even if all displays are closed, you will still be able to call functions like DisplayBrush(). They will still draw their graphics to the display, even if it is currently not visible. That is why you can also call SelectDisplay() on closed displays.

Make sure that you do not confuse SelectDisplay() with the similarily named functions SelectBrush(), SelectBGPic(), SelectAnim(), SelectMask(), and SelectAlphaChannel(). All of these functions require you to call EndSelect() when you are done with them, but SelectDisplay() does not have this requirement. In fact, it works in a completely different way so you must never call EndSelect() for SelectDisplay(). If you want to return to the previously current display, you must call SelectDisplay() again. Calling EndSelect() to restore the previously current display will definitely not work.

If you call SelectDisplay() when SelectBrush() (or one of its related commands) is active, Hollywood will internally call EndSelect() first to finish the SelectBrush() operation. After that, SelectDisplay() will switch the current display.

Double-buffering modes are not cancelled by SelectDisplay(). You can safely take the focus away from a double buffered display using SelectDisplay(), make some changes in another display, and then return to the double-buffered display. Double-buffered modes are fully preserved by SelectDisplay().

Also note that OpenDisplay() will always automatically select the specified display as the current one, except when you specify use the optional argument to tell it not to do so. Thus, when using OpenDisplay() you normally do not have to call SelectDisplay() at all. SelectDisplay() is only needed when selecting a display as the current one that is already open.

identifier of the display to select as the current display
optional: set this to True if the display shall not be activated by this function (defaults to False)

Show TOC