About Presentation Parameters

An application can attach any presentation parameter to a window. However, the window's implementation determines whether or not the presentation parameter will have an effect on the window. For example, if a window does not contain any text, the window will ignore the setting of a font presentation parameter. In general, a well-behaved window should support the more commonly used presentation parameters, such as those for setting the foreground and background colors and the text font. OS/2 uses presentation parameters to let users change window fonts and colors by dragging colors and fonts from Workplace Shell palettes and dropping them in the window. If a window does not support the correct presentation parameters, it can appear unresponsive to the user's actions.

By default, presentation parameter values are inherited from the window's owner. Suppose you create a dialog window that has radio buttons. You don't have to set the same background color in both the dialog window and the radio buttons because the radio button will inherit its background color from the dialog window. Any time the dialog's background color is changed, the radio button's color changes automatically.

WinSetPresParam is used to attach a presentation parameter to a window. Although any presentation parameter index can be used, windows typically support only a small subset of the possible values. For example, the Presentation Manager controls support the PP_FONTNAMESIZE presentation parameter and several of the color and color index presentation parameters. Setting a supported presentation parameter to a window will cause the window to repaint itself, making use of the new value.

Setting a color presentation parameter to a window does not automatically change a color. It is up to the window's implementation to query the presentation parameter's value, and then use it when updating the window.


[Back: Presentation Parameters]
[Next: Querying and Setting Presentation Parameters]